General Fear
Member
- Joined
- Dec 22, 2012
- Messages
- 12
- Programming Experience
- 10+
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 custom control to recognize the form the custom control save button 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. Our checking occurs when the user leaves the control.
Code:
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)
mtb.Focus()
SendKeys.SendWait("{TAB}")
If Not mtb.IsValidated Then
mtb.Focus()
Exit Do
End If
End If
ctrl = Me.GetNextControl(ctrl, True) 'Get the next control in the tab order.
Loop
I wanted to put the code below into a save custom control. The problem is that how do I get a custom control to recognize the form the custom control save button 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. Our checking occurs when the user leaves the control.
Code:
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)
mtb.Focus()
SendKeys.SendWait("{TAB}")
If Not mtb.IsValidated Then
mtb.Focus()
Exit Do
End If
End If
ctrl = Me.GetNextControl(ctrl, True) 'Get the next control in the tab order.
Loop