August 4th, 2013, 02:27 PM
Custom Save button finding parent form it resides on
I am using VB 2010.
I wanted to put the code below into a save custom control. The problem is that how do I get a command button custom control to recognize the form that the save button custom control sits on? Is it possible to have the code below in a button custom class. If so it would be good because the company will have a "universal save checking" as a default behavior. And our checking occurs when the user leaves the control.
Dim ctrl As Control = Me.GetNextControl(Me, True) 'Get the first control in the tab order.
Do Until ctrl Is Nothing 'Use ctrl here.
If (TypeOf ctrl Is clsTextBox) Then
Dim mtb As clsTextBox = CType(ctrl, clsTextBox)
If Not mtb.IsValidated Then
ctrl = Me.GetNextControl(ctrl, True) 'Get the next control in the tab order.
Click Here to Expand Forum to Full Width