【问】如何让Label控件在禁用状态下其文字不变灰?
禁用了Label,其文字就灰了(本来应该是彩色的)
只要解决了显示颜色问题就可以。
别问我干什么用,就这一个技术问题而已,呵呵:)
[解决办法]
http://topic.csdn.net/t/20020630/18/839591.html
[解决办法]
简单。把它放到一个无边框的 Frame 中,然后禁用 Frame。
[解决办法]
Label 控件本身就不能得到焦点,没必要特意设置 Enabled = False
[解决办法]
你用子类化,改一下label的单击事件,改面下面控件要执行的事件不就行了吗
[解决办法]
同意楼上...
sub label1_MouseMove(button,x,y)
call form_mousemove(button,label1.left+x,label1.top+y)
end sub
为什么非要尽用label?目的是让下面得控件即使鼠标在label上时也能得到事件?
[解决办法]
新建一个 UserControl,将 WindowsLess 属性设计为 True,里面添加一个 Label 控件,代码如下:
Option Explicit
Public Property Get Caption() As String
Caption = Label1.Caption
End Property
Public Property Let Caption(ByVal RHS As String)
Label1.Caption = RHS
PropertyChanged "Caption "
End Property
Private Sub UserControl_Initialize()
UserControl.Enabled = False
UserControl.BackStyle = vbTransparent
Label1.AutoSize = True
Label1.BackStyle = vbTransparent
End Sub
Private Sub UserControl_InitProperties()
Me.Caption = Extender.Name
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Me.Caption = PropBag.ReadProperty( "Caption ", vbNullString)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "Caption ", Me.Caption, vbNullString
End Sub