|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Form Properties Changes On It's Own!Sometimes I find that though I have specified the height & width of a
Form (in the Properties Window), after running it, the value/s changes on its own. For e.g. I set the height of a Form to 4135 but after running it once, I find VB changing it to 4140! Though a difference of 5 (pixels, is it...or points?) hardly makes any difference, why does this happen & how do I make VB adhere to the property values that I have set? Thanks, Arpan "Arpan" <arpan***@hotmail.com> wrote in message At normal font sizes there are 15 twips per pixel. Since you can't specify news:1128892886.423127.8380@g49g2000cwa.googlegroups.com... > Sometimes I find that though I have specified the height & width of a > Form (in the Properties Window), after running it, the value/s changes > on its own. For e.g. I set the height of a Form to 4135 but after > running it once, I find VB changing it to 4140! Though a difference of > 5 (pixels, is it...or points?) hardly makes any difference, why does > this happen & how do I make VB adhere to the property values that I > have set? anything smaller than a pixel, VB will round twip settings to the nearest multiple of 15. Forms position and size are always in Twips, which is usually 15 twips per
pixel, it's not fixed, but it depend on the screen's resolution. Use Screen.TwipsPerPixelX and Screen.TwipsPerPixelY to find out their values. Don't hard code them as constants. In your case, 4135/15 = 275.666666 Pixels, so VB rounded it up 276 pixels, which equals 4140 twips. Try this code which prints the screen resolution in Twips and Pixels: Private Sub Form_Load() Debug.Print Screen.Width, Screen.Height Debug.Print Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY End Sub Also, if you want more fine control of where you place your controls, change the grid settings in the VB6's Options. Show quoteHide quote "Arpan" <arpan***@hotmail.com> wrote in message news:1128892886.423127.8380@g49g2000cwa.googlegroups.com... > Sometimes I find that though I have specified the height & width of a > Form (in the Properties Window), after running it, the value/s changes > on its own. For e.g. I set the height of a Form to 4135 but after > running it once, I find VB changing it to 4140! Though a difference of > 5 (pixels, is it...or points?) hardly makes any difference, why does > this happen & how do I make VB adhere to the property values that I > have set? > > Thanks, > > Arpan >
.NOT My Views
How should one form call another? Why can't I test class functions from the Immediate window? advanced tooltip bubbles question Reverse Array order ? Cannot Load Form! How to handle data types in custom Max/Min function? Point me in the right direction - Mouse utility... Simulation! Which Form Has Invoked The Sub! |
|||||||||||||||||||||||