Click here to Skip to main content
15,915,513 members
Home / Discussions / C#
   

C#

 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 9:06
Tony Pottier18-Dec-08 9:06 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 9:37
Tony Pottier18-Dec-08 9:37 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 9:58
Tony Pottier18-Dec-08 9:58 
GeneralRe: Get rid of label margins Pin
DaveyM6918-Dec-08 11:21
professionalDaveyM6918-Dec-08 11:21 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 11:27
Tony Pottier18-Dec-08 11:27 
GeneralRe: Get rid of label margins Pin
Luc Pattyn18-Dec-08 12:50
sitebuilderLuc Pattyn18-Dec-08 12:50 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 13:34
Tony Pottier18-Dec-08 13:34 
GeneralRe: Get rid of label margins Pin
Luc Pattyn18-Dec-08 13:46
sitebuilderLuc Pattyn18-Dec-08 13:46 
Tony_P wrote:
I need the width/height of the label without painting it


Huh? if you need it inside OnPaint only, then do the MeasureString in OnPaint just before you
use DrawString. if you need its result outside OnPaint, I would try and execute OnPaint once
before you need the sizes.

Keeping a Graphics does not feel right; for one it is an expensive object, and it contains many things that may be different each time you get a graphics; e.g. every time you move ab object over a Form, the Form may get Paint events with varying clip regions in the Graphics object. Also the user might change the resolution of the screen, and whatever more.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Fixturized forever. Confused | :confused:


GeneralRe: Get rid of label margins Pin
#realJSOP18-Dec-08 23:52
professional#realJSOP18-Dec-08 23:52 
GeneralRe: Get rid of label margins Pin
Luc Pattyn19-Dec-08 0:15
sitebuilderLuc Pattyn19-Dec-08 0:15 
QuestionHi Pin
bhatted18-Dec-08 7:20
bhatted18-Dec-08 7:20 
AnswerRe: Hi Pin
Dave Kreskowiak18-Dec-08 8:30
mveDave Kreskowiak18-Dec-08 8:30 
QuestionStatus Strip Progress bar graphics not accurate???!!! Pin
LongRange.Shooter18-Dec-08 6:50
LongRange.Shooter18-Dec-08 6:50 
AnswerRe: Status Strip Progress bar graphics not accurate???!!! Pin
led mike18-Dec-08 7:57
led mike18-Dec-08 7:57 
AnswerRe: Status Strip Progress bar graphics not accurate???!!! Pin
Dave Kreskowiak18-Dec-08 8:03
mveDave Kreskowiak18-Dec-08 8:03 
GeneralRe: Status Strip Progress bar graphics not accurate???!!! Pin
LongRange.Shooter19-Dec-08 3:37
LongRange.Shooter19-Dec-08 3:37 
GeneralRe: Status Strip Progress bar graphics not accurate???!!! Pin
Dave Kreskowiak19-Dec-08 12:06
mveDave Kreskowiak19-Dec-08 12:06 
AnswerRe: Status Strip Progress bar graphics not accurate???!!! Pin
Alan N18-Dec-08 8:07
Alan N18-Dec-08 8:07 
AnswerRe: Status Strip Progress bar graphics not accurate???!!! Pin
Tony Pottier18-Dec-08 8:48
Tony Pottier18-Dec-08 8:48 
QuestionSockets Best Practices Pin
menzelAtPCA18-Dec-08 6:43
menzelAtPCA18-Dec-08 6:43 
AnswerRe: Sockets Best Practices Pin
led mike18-Dec-08 7:53
led mike18-Dec-08 7:53 
AnswerRe: Sockets Best Practices Pin
Ben Fair18-Dec-08 8:54
Ben Fair18-Dec-08 8:54 
Questionenter instead tab key Pin
ArielR18-Dec-08 6:25
ArielR18-Dec-08 6:25 
AnswerRe: enter instead tab key Pin
Giorgi Dalakishvili18-Dec-08 7:19
mentorGiorgi Dalakishvili18-Dec-08 7:19 
QuestionHow to add video in Visual Studio C# Pin
Sokka9318-Dec-08 5:59
Sokka9318-Dec-08 5:59 

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.