Skip to main content
GameDev.net gamedev.net
🔒 Locked

VB 6.0 BIG problem!

Started by Estauns May 31, 2002 at 2:41 PM 5 replies 300+ views
Original Post
Estauns
Estauns
Hi I''m having a big problem with my VB program. I have this form and I want the form to be 6000 twips by 6000 twips, but VB has this nasty habit of changing this to something like 5975 x 5975 or something like that. Then I have these 3 x 3 grid of Command Buttons, that I all want touching eachother... But when I align them, they get all screwy. And when I align them perfectly through code, they''ll be seperated by like 1 pixel or something at run time. This is just ridiculous! How can I turn off ALL of VBs movement / rearrangement junk? I know WHERE I want my stuff and how big it should be (width and height), but VB seems to think it knows better. Any ideas?
"Where genius ends, madness begins."Estauns
Pyabo
Pyabo
Ah yes, the infamous Software That Thinks Its Smarter Than You Are problem... Microsoft is very good at this sort of thing.

For your first problem, however, I think there may not be a solution. As far as I know, at the OS level your forms and whatnot are measured in device coordinates (pixels), not in TWIPS. So 5975 is probably the closest TWIP measurement that corresponds to the pixel size of your form. But hey, I''m just guessing here...

As for the other problem... no clue. You shouldn''t have any problems lining up your buttons to touch each other if you are using the grid guide.
Pyabo
Pyabo
Oh, one more suggestion... you could use user-draw buttons instead of standard buttons and then draw them however you want.
Michalson
Michalson
Yes, wonderful twips. Introducing imperial like measurements into computing. If I remember correctly there are 1440 twips to an inch (which is totally useless when designing for computer monitors which are concerned with pixels regardless of how big a single pixel is), however you could look for the TwipsPerPixel property (I can't remember if its in VB or only VBScript) and use that to do the correct conversion at runtime (though they won't allows line up correctly anyway since VB converts back and forth between twips)

[EDIT] Actually eldee's idea sounds better.

[edited by - Michalson on May 31, 2002 4:13:03 PM]
Omaha
Omaha
Actually, if memory serves, twips are not useless and extraneous, but rather serve as more of something I''m sure Microsoft would call the UAL (Unit abstraction layer) that serves as a link between physical measurements and screen pixels for use in programs where inches, not pixels need to count: For instance, in a publication program or CAD system.
Michalson
Michalson
Yep, there based off the same principle as printer DPI, however when programming I would think that pixel measurements would be far more appropriate. While twips may be the default measurement for VB controls, I would guess that less than 1% of apps designed with VB (slightly high in other languages, but still low) would be in the particular category (CAD, Desktop Publishing) to need DPI accuracy over pixel control. My argument is why make the majority of VB programmers bend over backwards in order for a tiny number of developers to have it a little bit easier (why not the other way: common stuff is easy, uncommon is hard)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.