0

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

3
Contributors
2
Replies
7
Views
5 Years
Discussion Span
Last Post by boyboy
1

Try 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
0

Here i want to make a car park system, but i have 10 button, if button 1 clicked and submit to other page, then after back to the car park page only the button 1 is red color and all button disable.... how the code....can anybody tell me?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.