Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi..Everybody

I want to Create dynamic properties for vb.net controls like (yes/no)

pls tell me..how to do it..
Posted
Updated 23-Jul-11 4:46am
v2

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.
 
Share this answer
 
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- 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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900