I want the msscript control to act as an event sink in vb6. I have found several references to this on msdn and othe rplaces, but no working examples. In theory, I should be able to do this:
myscriptcontrol.AddObject "mybutton", Command1
myscriptcontrol.Addcode "sub mybutton_Click()" & vbCrLf & _
"msgbox" & Chr(34) & "button click" & Chr(34) & vbCrLf & "end sub"
myscriptcontrol.State = Connected
Then when Command1 is clicked the event should be passed down to the mybutton_Click through the script control.
But it doesn't work and my work will be much cleaner if I can make it work.
Thanks,
Karl
myscriptcontrol.AddObject "mybutton", Command1
myscriptcontrol.Addcode "sub mybutton_Click()" & vbCrLf & _
"msgbox" & Chr(34) & "button click" & Chr(34) & vbCrLf & "end sub"
myscriptcontrol.State = Connected
Then when Command1 is clicked the event should be passed down to the mybutton_Click through the script control.
But it doesn't work and my work will be much cleaner if I can make it work.
Thanks,
Karl