Let say I have many many buttons and i want to change all the forecolor of the buttons by clicking on one button.
How to do it?
I no want type like btn1.forecolor,btn2.forecolor......... because I have more than 20 buttons
reds8
0
Newbie Poster
Recommended Answers
Jump to PostTry this :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim btn As Control For Each btn In Me.Controls If TypeOf btn Is Button Then btn.ForeColor = Color.Blue End If Next End Sub
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.