by
455 17
0
4
2,896
0
Top 1% !
Famous
Specified
OpenSource
Popularity: 4967th place
No tags for this snippet yet.
Languagevb.net

Batch Control Style

Example regarding the control styling. 
This example applies a new color on all the buttons of your current form.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1099877/Batch-Control-Style?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load btn = Me.Controls.OfType(Of Button)().Where(Function(c) c.Name.Contains("")).ToArray() End Sub Private Sub Recolor() Dim i As Integer = 0 While i < btn.Count btn(i).Enabled = True btn(i).BackColor = Color.Yellow i += 1 End While End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Recolor() End Sub
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus