.NET 1.1中的动态控件属性 [英] Dynamic Controls properties in .net 1.1
本文介绍了.NET 1.1中的动态控件属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好.
我想为vb.net控件(例如(是/否))创建动态属性
请告诉我..怎么做..
Hi..Everybody
I want to Create dynamic properties for vb.net controls like (yes/no)
pls tell me..how to do it..
推荐答案
您的问题非常笼统,没有任何信息.如果要从用户输入中接收是"或否"答案,则可以使用按钮.
Your question is very general and has no info. If you want to recieve a yes or no answer form user inputs, you can use buttons.
1-在VB.NET中打开一个新的Windows应用程序项目. 2-添加一个类,将新类的文件名更改为newCheckBox
3-打开类的代码窗口并添加以下代码:
1- Open a new Windows Application project in VB.NET.
2- add a class, Change the file name of the new class to newCheckBox
3- open the code window for the class and add this code:
Public Class newCheckBox
Inherits CheckBox
Private myYesNo As String
Property YesNo() As String
Get
Return myYesNo
End Get
Set(ByVal Value As String)
myYesNo = Value
End Set
End Property
End Class
4-打开表单加载事件过程的代码窗口,并添加以下代码:
4- Open the code window for the form load event procedure and add this code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MyCheckbox As New newCheckBox
Controls.Add(MyCheckbox)
End Sub
这篇关于.NET 1.1中的动态控件属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文