VB.NET Stylise Your Forms like you would with CSS on a webpage

Code

Sub Stylize(frm As Form)
 Dim Con As Control
 For i = 0 To frm.Controls.Count - 1
                Con = frm.Controls(i)
                If TypeOf Con Is TextBox Then Con.ForeColor = Color.Red
                If TypeOf Con Is Button Then Con.FlatStyle = FlatStyle.Flat
 Next
End Sub

This is just an example, setting textbox's forecolor to Red, and buttons style to Flat.

You might also like...

Comments

 phill

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Every language has an optimization operator. In C++ that operator is ‘//’”