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


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
End Sub

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

You might also like...




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.

“Better train people and risk they leave – than do nothing and risk they stay.” - Anonymous