Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Estauns

VB 6.0 BIG problem!

This topic is 5895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Oh, one more suggestion... you could use user-draw buttons instead of standard buttons and then draw them however you want.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!