Pixels vs. Twips
- From: Robert W. <RobertW@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 11 Apr 2005 11:06:03 -0700
I'm building a simple Windows Form with tabs at the top. I'm writing some
code to ensure that each tab will be wide enough to accomodate the text that
will go in it - for both English and other languages.
So I used the MeasureString method to figure out the width of the text.
This came back in pixels. Fine. But then I went to the TabPage object to
get its width. To my great surprise the width value was in Twips, even
though articles like this say this isn't so:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vxconchangestoscreenobjectinvisualbasicnet.asp
>From previous experience in VB6 I've learned that one cannot always depend
upon 1 Pixel = 15 Twips. On some screen resolutions I've seen 1:12.
So, I'm wondering if the TabPage.Width value is a known bug in .Net and if
there's a workaround that anyone knows of.
Sincerely,
Robert W.
Vancouver, BC
.
- Prev by Date: Passing parameters by reference
- Next by Date: Re: convert int[] to byte[]
- Previous by thread: Passing parameters by reference
- Next by thread: WindowProc and RegisterWindowMessage
- Index(es):
Relevant Pages
|