I have an array of TextBox. How do I at design time change the size of all of them. They all have the same size but I want them to be bigger.
Printable View
I have an array of TextBox. How do I at design time change the size of all of them. They all have the same size but I want them to be bigger.
Try:
Code:For Each MyControl In Me.Controls
If TypeOf MyControl Is Textbox Then MyControl.FontSize = "18"
Next
Code:'change the size of a textbox control array at design time
Private Sub Command1_Click()
Dim intCre As Integer
For intCre = 0 To Text1.Count - 1
Text1(intCre).Width = 450
Text1(intCre).Height = 450
Next
End Sub
It looks more like at run time to me. Is it not possible to do it with the mouse draging and so as I would have done if it was only one textbox.
Oooops...sorry.it's early...
Not by dragging but if you select all textboxes.ie hold down the Ctrl button and select eact text box you can then fress f4 for properties andt change the properity
Ex. Width and it will affect all the text boxes.
Thanks, now it works. I learned from the code also so thanks again.
Actually you can do this with the keyboard. Select all the controls you want to change the size for then hold down the shift key and press one of the arrow keys. If you hold down the CTRL key instead of shift you will move the controls on the form.
Good luck!
That was the thing I was looking for, I remebered it then I saw it. Thanks ! /AKA
interesting! hadn't seen that before...
Thanks as well!