M
matt
is it possible to change a setting, such as Forecolor for all text in a
form, or do you have to change it for each text block?
form, or do you have to change it for each text block?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
matt said:is it possible to change a setting, such as Forecolor for all text in a
form, or do you have to change it for each text block?
Chris said:Find and replace.
Find ".ForeColor = "
Replace ".ForeColor = NewForeColor '"
Chris said:Find and replace.
Find ".ForeColor = "
Replace ".ForeColor = NewForeColor '"
Siva M said:I don't think so. But, the whole thing can be shortened as:
For Each c As Control In Me.Controls
If TypeOf (c) Is Label Then
DirectCast(c, Label).ForeColor = Color.Coral
End If
Next
Probably because that you have controls in controls. This is easy toThis is great, and is basically what i was going for. However, i tried
putting it into my code and it isn't working correctly. I see that it
goes into the for loop, but only once, it isn't looping through all of the
properties. any ideas?
Siva M said:I don't think so. But, the whole thing can be shortened as:
For Each c As Control In Me.Controls
If TypeOf (c) Is Label Then
DirectCast(c, Label).ForeColor = Color.Coral
End If
Next
matt said:is it possible to change a setting, such as Forecolor for all text in a
form, or do you have to change it for each text block?
Cor Ligthert said:Shiva
Probably because that you have controls in controls. This is easy to
overcome by doing this recursive.
\\\
SetColors(me)
Public sub SetColors(byval this as controls)
For Each c As Control In This.Controls
If TypeOf (c) Is Label Then
DirectCast(c, Label).ForeColor = Color.Coral
End If
SetColors(c)
Next
///
Watch typos it is changed in this message.
I hope this helps,
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.