Form objects...

s15199d

Registered User.
Local time
Yesterday, 20:36
Joined
Jan 4, 2005
Messages
10
Is there a function that allows you to select all of the form objects.

What I want to do is to select all the form objects...have the user select a # from a drop-down list. Then set the font-size property to all of the form objects to that #. Does that make since?

Is this possible?
 
Well, I guess something in this way could functions:

Sub Form_Load()
Dim MyControl as Control

MyControlList.Clear 'MyControlList is a ComboBox

For Each MyControl in MyForm.Controls
MyControlList.Add MyControl.Name
Next MyControl
End Sub

After this, you can create a button to change the control font size:

Sub btChangeFontSize_Click() 'btChangeFontSize is a CommandButton
Dim newFontSize as Integer
newFontSize = Format(InputBox "Enter the new font size for " & MyControlList, "#")
MyForm.Controls(MyControlList).FontSize = newFontSize
End Sub

I didn't test that code, but I guess it function. Maybe it need some adjustment... With certainty it need a treatment of error... :rolleyes:
 

Users who are viewing this thread

Back
Top Bottom