Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
GeneralRe: A question on garbage collection Pin
spif200114-Apr-05 19:51
spif200114-Apr-05 19:51 
GeneralRe: A question on garbage collection Pin
Disrupted14-Apr-05 19:55
Disrupted14-Apr-05 19:55 
GeneralRe: A question on garbage collection Pin
Alex Korchemniy14-Apr-05 20:07
Alex Korchemniy14-Apr-05 20:07 
GeneralRe: A question on garbage collection Pin
Disrupted14-Apr-05 20:18
Disrupted14-Apr-05 20:18 
Generalautoesize or fit labels height Pin
alexdg0414-Apr-05 18:50
alexdg0414-Apr-05 18:50 
GeneralRe: autoesize or fit labels height Pin
Alex Korchemniy14-Apr-05 18:54
Alex Korchemniy14-Apr-05 18:54 
GeneralRe: autoesize or fit labels height Pin
alexdg0414-Apr-05 19:13
alexdg0414-Apr-05 19:13 
GeneralRe: autoesize or fit labels height Pin
Alex Korchemniy14-Apr-05 19:42
Alex Korchemniy14-Apr-05 19:42 
Do away with labels completely. I'm assuming that you have no other controls in the way to worry about. Instead handle the Paint event for the form. Inside the paint event "draw" the strings that you have. For each string you draw you keep a record of the location. You can also add padding if necessary. Also make sure that everything is redrawed when resize occurs.

Off the top of my head and not tested:

Graphics g = e.Graphics;<br />
int currentY = 0;<br />
foreach(string s in myStringArray)<br />
{<br />
	SizeF sz =  g.MeasureString(s, this.Font, this.Width);<br />
	g.DrawString(s, this.Font, Brushes.Black, new Rectangle(0, currentY, (int)sz.Width, (int)sz.Height));<br />
	currentY += (int)sz.Height;<br />
	currentY += 10; //padding between strings<br />
}


Alex Korchemniy
Generalminimize form while closeing Pin
alexdg0414-Apr-05 18:43
alexdg0414-Apr-05 18:43 
GeneralRe: minimize form while closeing Pin
Alex Korchemniy14-Apr-05 18:51
Alex Korchemniy14-Apr-05 18:51 
GeneralRe: minimize form while closeing Pin
Polis Pilavas15-Apr-05 4:45
Polis Pilavas15-Apr-05 4:45 
GeneralLog4Net - changing appender configuration programmatically... Pin
devvvy14-Apr-05 16:03
devvvy14-Apr-05 16:03 
Generalserialization problem with a class that derives from dataset Pin
god4k14-Apr-05 15:57
god4k14-Apr-05 15:57 
GeneralRe: serialization problem with a class that derives from dataset Pin
turbochimp14-Apr-05 16:33
turbochimp14-Apr-05 16:33 
GeneralRe: serialization problem with a class that derives from dataset Pin
god4k14-Apr-05 18:01
god4k14-Apr-05 18:01 
GeneralRe: serialization problem with a class that derives from dataset Pin
god4k14-Apr-05 18:41
god4k14-Apr-05 18:41 
QuestionHow to copy tables? Pin
ben214-Apr-05 13:18
ben214-Apr-05 13:18 
AnswerRe: How to copy tables? Pin
turbochimp14-Apr-05 16:56
turbochimp14-Apr-05 16:56 
GeneralRe: How to copy tables? Pin
ben219-Apr-05 11:50
ben219-Apr-05 11:50 
AnswerRe: How to copy tables? Pin
Alex Korchemniy14-Apr-05 19:00
Alex Korchemniy14-Apr-05 19:00 
GeneralBuilding Addin Pin
MAF14-Apr-05 12:00
MAF14-Apr-05 12:00 
GeneralRe: Building Addin Pin
Dave Kreskowiak14-Apr-05 16:52
mveDave Kreskowiak14-Apr-05 16:52 
GeneralInterting page break richTextBox Pin
Member 156981014-Apr-05 11:41
Member 156981014-Apr-05 11:41 
GeneralRe: Interting page break richTextBox Pin
Sebastian Schneider14-Apr-05 21:34
Sebastian Schneider14-Apr-05 21:34 
GeneralRe: Interting page break richTextBox Pin
Ashok Dhamija15-Apr-05 1:03
Ashok Dhamija15-Apr-05 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.