【发布时间】:2012-01-27 16:39:05
【问题描述】:
我在application settings 中设置了我的Form text 的名称,我需要rewrite 它。有没有可能,因为它告诉我它只是一个readonly。
我知道我们可以使用 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 次?
-
我正在尝试使用配色方案和字体来绘制组合框,例如边框颜色、字体颜色、背景颜色。