Question:
I am resizing my widows during runtime. I also want my dialogboxes to resize with the window. My program is doing thiscorrectly. But it is not resizing the command buttons in thedialog 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 anymention of this.
Answer:
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.