Dear All,
I have derived a textbox. This user control works fine everywhere. However, i have added a property in this as follow:
The reason behind this property is very simple. I want myself to be able to set this property of the textbox to TRUE if the value that is to be saved in the database can be null or not. If it is FALSE, then i will restrict the user to enter something in the textbox first. This also works fine. At design time, i can select True/False from the property.Code:Public _propertyValue As Boolean Public Overridable Property AllowNull() As Boolean Get Return _propertyValue End Get Set(ByVal value As Boolean) _propertyValue = value End Set End Property
Now, here is the problem. I am working in a MDI environment, therefore, i want to check all the textboxes with FALSE option selected for AllowNull property before saving the data.
I have written this piece of code:
how do i make user defined property global and accessible through this code, what am i doing wrong here?Code:Public Function checkAllTextBoxes() As Boolean Dim ctrl As Control For Each ctrl In Me.ActiveMdiChild.Controls If TypeOf ctrl Is MyTextBox.mytextbox Then 'NOW I WANT TO ACCESS THE PROPERTY ALLOWNULL HERE 'LIKE THIS. If ctrl.allowNull = false Then 'However, it only shows me the default textbox properties like allowdrop etc. End If End If Next End Function




Reply With Quote
