Jump to content
  • Advertisement

Archived

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

Crizz

Wrong Form Resizing in VB..grrrr

This topic is 6930 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

Please help me on that! I create a PictureBox with index property set to 1. Then in Run-time, I create some others with the "load" even (ex.load Picturebox(2)). And move the one under the other with the same space between them! All PictureBoxes have the same size and they have Borders! So, After that I want to resize the form so all my PictureBoxes fit in the form! I calculate the new formheight like that! NewFormsHeight = PictureBox(1).Height*PictureBox.Count + Space*(PictureBox.Count-1) Form1.Height = NewFormsHeight But even after that the last PictureBox isn''t shown entirely in the form! Why is that? Anything Have to do with "Scale" oe something? Or I must cound the Picture and Forms Borders,too? I so how I do that? Please Help me on that, because it drives me crazy, Crizz

Share this post


Link to post
Share on other sites
Advertisement
This problem stems from the fact that a VB form''s main scale mode is in TWIPS.

Your space might be in PIXELS.

And if your form''s scale mode is set to PIXEL as well so will your picbox''s width and height.

As TWIPS are smaller in distance than PIXELS (1 pixel = (more or less) 14.5 TWIPS) therefore your picboxes are being cropped.

All in all it''s pretty complicated, and I guess you''ll have to find out yourself. Here are the functions you should look up in MSDN :-

ScaleX,ScaleY

These methods can convert numbers from PIXELS to TWIPS and vice versa. So go give it a try first.


To remove the border on the picture boxes just set the borderstyle property to 0.

-------------------------
-Now Working on Pokemon like Engine!

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!