codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Text wrapping on C# webforms buttons  annabel69 at 14:40 on Tuesday, August 21, 2007
 

Can anyone help? I'm new to C# and .net, and this is driving me crazy.
I am reading database values to set the text on buttons. Some strings need to wrap onto 2 lines. In ASP I seem to be able to enter in a code to force a new line, but this doesn't work when I try it in C#, either by splitting the string and inserting a code, or even putting it into the string in my database.

Does anyone know any way I can get the button text to wrap automatically as it seems to in windows forms? Or can anyone suggest a way of dealing with long text?

I would REALLY appreciate any help.

Cheers
Annabel

  Re: Text wrapping on C# webforms buttons  ewalker at 19:26 on Wednesday, September 12, 2007
 

Annabel,

I am having the exact same problem. Have you found a solution yet?

Cheers,
Eric
Bell's Brewery, Inc.

  Re: Text wrapping on C# webforms buttons  annabel69 at 14:24 on Thursday, September 13, 2007
 

No, I've tried lots of different things but had to give up and make the buttons bigger.

  Re: Text wrapping on C# webforms buttons  iorunner at 19:55 on Friday, January 23, 2009
 

After you have presized your button to fit the text, set the text property in the page load event like this: Button2.Text = "Add To and View" + "\r\n" + "Wait List";

or whatever text you need. Granted, if you're grabbing your text dynamically, using this method you would have to create an algorithm to size the button as well as decide where to brek the text.

  Re: Text wrapping on C# webforms buttons  annabel69 at 08:26 on Sunday, January 25, 2009
 

Cheers, I'll give it a go!!

Annabel








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Problem to declare global variable in Object oriented perl
•  Re: dereferenceing a string to a constant name
•  Re: Submit multiple forms with one button
•  Re: Passing Password using $ssh->cmd
•  Re: ADODB.Recordset error (0x800A0CB3)
•  Re: Open a Modal Pop Up From a LinkButton In a GridView
•  Re: Need Javascript Multiple sidebar menu with sliding effects
•  Re: ASP.NET /Excel opening in frame Issue
•  Re: `section` is an unexpected token. Expecting white space. Line 1, position 137.


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010