HansVanSteen
New Member
- Joined
- Jun 20, 2012
- Messages
- 3
(each time the text says "On Click", one has to read this as one word without the space. That word is censored . I suppos to avoid scripting )
In a userform I use radio buttons (a frame holding option buttons, only one is depressed) and don't want to scan all objects to check the status. My idea is to have a generic event procedure to catch all On click events and set the "tag" property of the frame. I tried something like the code below.(Userform_initialise)
Normally in delphi I would call the inherited On Click and assign an OVERRULE procedure to do this but being a newbee to VB I have not the foggiest idea how to do this.
Private Function OptionButtonOn ClickEvent(ctrl As Control)
ctrl.Parent.Tag = ctrl.Caption
End Function
Sub Userform_Initialise()
Dim ctrl As Control
For Each ctrl In MainForm.Controls
If InStr(Ctrl.name, "Option") <> 0 Then
Rem Set ctrl!on Click = OptionButtonOn ClickEvent(ctrl)
End If
Next ctrl
End Sub
In a userform I use radio buttons (a frame holding option buttons, only one is depressed) and don't want to scan all objects to check the status. My idea is to have a generic event procedure to catch all On click events and set the "tag" property of the frame. I tried something like the code below.(Userform_initialise)
Normally in delphi I would call the inherited On Click and assign an OVERRULE procedure to do this but being a newbee to VB I have not the foggiest idea how to do this.
Private Function OptionButtonOn ClickEvent(ctrl As Control)
ctrl.Parent.Tag = ctrl.Caption
End Function
Sub Userform_Initialise()
Dim ctrl As Control
For Each ctrl In MainForm.Controls
If InStr(Ctrl.name, "Option") <> 0 Then
Rem Set ctrl!on Click = OptionButtonOn ClickEvent(ctrl)
End If
Next ctrl
End Sub