Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996



Building the Right Environment to Support AI, Machine Learning and Deep Learning

ScaleWidth vs Width

I am resizing my widows during runtime. I also want my dialog boxes to resize with the window. My program is doing this correctly. But it is not resizing the command buttons in the dialog box, which are the same width as the dialog box. I have given the command: Command1.Width = Dialog1.Width.

This gives me an error message of "Overflow!". I guess I need to resize the text inside the command button. If that is so How do I do it? I have gone thru all the resources you have noted previous to this question page and have not seen any mention of this.

Try doing this: Command1.Width = Dialog1.ScaleWidth. I would assume that Dialog1 is your form. The ScaleWidth property specifies the available width for controls within it. Most controls that can be used as containers have a ScaleWidth property also.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date