我已经在application settings
中设置了我的Form text
的名称,我需要rewrite
它。它可能是因为它告诉我它只是一个readonly
。在Windows窗体中重写设置
我知道我们可以简单地通过使用me.text=""
来改变它但我在我的应用程序中有一个问题,因为我有下面的代码,每次窗体加载时它都会擦除文本。
Protected Overrides Sub OnLayout(ByVal e As System.Windows.Forms.LayoutEventArgs)
MyBase.OnLayout(e)
'Me.Text = CStr(Val(Me.Text) + 1)
FillList()
MyBase.OnLayout(e)
If FontColor.Items.Count = 0 Then
FontColor.Items.AddRange(Known_Color)
FontColor.MaxDropDownItems = 20
End If
MyBase.OnLayout(e)
If OutlineColor.Items.Count = 0 Then
OutlineColor.Items.AddRange(Known_Color)
OutlineColor.MaxDropDownItems = 20
End If
MyBase.OnLayout(e)
If BorderColor.Items.Count = 0 Then
BorderColor.Items.AddRange(Known_Color)
BorderColor.MaxDropDownItems = 20
End If
MyBase.OnLayout(e)
If BackgroundColor.Items.Count = 0 Then
BackgroundColor.Items.AddRange(Known_Color)
BackgroundColor.MaxDropDownItems = 20
End If
End Sub
是否有任何解决方法可以做到这一点?
你为什么要打电话MyBase.OnLayout(E)的5倍? – TheBoyan 2011-12-25 18:52:42
我想绘制组合框的颜色方案和字体,如边框颜色,字体颜色,背景颜色。 – coder 2011-12-25 18:54:50