Click here to Skip to main content
15,905,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
   Public backcolor1 As Color = Color.blue
   Public bawhite As Color = Color.White

Public Sub themes()

  Me.BackColor = backcolor1
        PictureBox1.BackColor = backcolor1
        Dim cControl As Control
        For Each cControl In Me.Controls

            If (TypeOf cControl Is Button) Then
                cControl.ForeColor = Color.Black
                cControl.Font = New Font(cControl.Font, FontStyle.Bold)
            End If

          
            If (TypeOf cControl Is TextBox) Then
                cControl.ForeColor = Color.Black
                cControl.Font = New Font(cControl.Font, FontStyle.Bold)
                cControl.BackColor = bawhite
            End If
            If (TypeOf cControl Is CheckBox) Then
                cControl.ForeColor = Color.Black
                cControl.Font = New Font(cControl.Font, FontStyle.Bold)
                cControl.BackColor = backcolor1
            End If
            If (TypeOf cControl Is ComboBox) Then
                cControl.ForeColor = Color.Black
                cControl.Font = New Font(cControl.Font, FontStyle.Bold)
                cControl.BackColor = bawhite
            End If
            
           
        Next cControl
    End Sub


What I have tried:

what i have tried to run themes in all forms at the load it don`t function in the second from how do i code and call so it can be use full in all forms
Posted
Updated 25-Jun-16 21:10pm

1 solution

Please see: Search CodeProject articles.

—SA
 
Share this answer
 
Comments
Maciej Los 26-Jun-16 15:12pm    
5!
Sergey Alexandrovich Kryukov 26-Jun-16 16:31pm    
Thank you, Maciej.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900