resizing a form size at runtime 
Author Message
 resizing a form size at runtime

I need to resize a form's internal area in pixels to a bmp's height and
width at runtime. I have tried modifying scalewidth and scaleheight
methods but they dont seem to work.
Any help would be greatly appreciated
-Adarsh



Wed, 20 Sep 2000 03:00:00 GMT  
 resizing a form size at runtime


Quote:
>I need to resize a form's internal area in pixels to a bmp's height and
>width at runtime. I have tried modifying scalewidth and scaleheight
>methods but they dont seem to work.
>Any help would be greatly appreciated
>-Adarsh

Hi,

All you need to do is place a picturebox on your form, assign the
picture to your picturebox, and then resize the form according to the
picture boxes height and width.

Shep Pharis,
VB5 Developer
Remove the _ from my email address to validate it.



Thu, 21 Sep 2000 04:00:00 GMT  
 resizing a form size at runtime

Quote:

> I need to resize a form's internal area in pixels to a bmp's height and
> width at runtime. I have tried modifying scalewidth and scaleheight
> methods but they dont seem to work.
> Any help would be greatly appreciated
> -Adarsh

 You have to modify Form1.Width & Form1.Height ( both in twips):

 ....
 Dim iExtraX As Integer, iExtraY as Integer
 Form1.ScaleMode = vbTwips
 iExtraX = Form1.Width - Form1.ScaleWidth 'Border size
 iExtraY = Form1.Height - Form1.ScaleHeight 'Caption & menu size
 ' PictureWidth & PictureHeight in pixels
 Form1.Width = Form1.ScaleX(PictureWidth,vbPixels,vbTwips)+iExtraX
 Form1.Height = Form1.ScaleY(PictureHeight,vbPixels,vbTwips)+iExtraY
 ....

--
---------------------------------------------------------------------
# When I find my code in tons of trouble,# Anton D. Onopko          #

# Speaking words of wisdom:              # Note: remove nospam if   #
# Write in C.                            # you mail to me           #
---------------------------------------------------------------------



Fri, 22 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Closing one form from another and resizing the entire form at runtime

2. Resizing a Form, changing Font Size on Controls

3. Resizing a form - minimum size

4. how can i RESIZE objects when the form changes size

5. Resize and move controls under the change of the Form size

6. Resize form to its controls size

7. Resizing Controls as The Form Size changes

8. Dynamic Resizing of a form &control based on picture size

9. Resize and move controls under the change of the Form size

10. VB 4.0 Form/Controls Auto Resize to Fit the Screen Size

11. API for controlling size of form when user resizes it

12. auto resizing Msflexgid to match form size

 

 
Powered by phpBB® Forum Software