专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > VB Dotnet

大家新年好呀。现有一有关问题需要,呀

发布时间:2011-06-23 15:55:56 文章来源:www.iduyao.cn 采编人员:星星草
大家新年好呀。现有一问题需要请教大家,请指教呀。
在.net自带的控件中,当控件的.Enabled   =   False时,其控件表面的文字和图像都是灰色的,但是,在自定义控件中,怎样处理当.Enabled   =   False时表面的图像呢?就是说怎样画一个灰色的图像呢?
谢谢了。

------解决方案--------------------
不是很明白什么意思

Public Class CustomControl1

Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)

'在此处添加自定义绘制代码
Dim Control_Button As New Button
Dim Control_Textbox As New TextBox
Control_Button.Location = New Point(0, 0)
Control_Textbox.Location = New Point(0, 30)

Me.Controls.Add(Control_Button)
Me.Controls.Add(Control_Textbox)
End Sub

End Class

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CustomControl11.Enabled = True Then
CustomControl11.Enabled = False
Else
CustomControl11.Enabled = True
End If
End Sub
End Class
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: