在VB.NET中为所有表单创建一个主题 [英] Create a theme for all form in VB.NET
本文介绍了在VB.NET中为所有表单创建一个主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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
推荐答案
请请参阅: 搜索CodeProject文章 。
-SA
这篇关于在VB.NET中为所有表单创建一个主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文