Dear The Expert,
How to creating an instance of an ActiveX control without placing it on a form? (ie. to create textbox control in module1.bas) and
how to trigger the event?
please advise ..
Regards
Winanjaya
Dear The Expert,
How to creating an instance of an ActiveX control without placing it on a form? (ie. to create textbox control in module1.bas) and
how to trigger the event?
please advise ..
Regards
Winanjaya
First of all do you really mean 'ActiveX' control? Or do you mean just creating a .NET control (which are not Active X controls). ActiveX controls are specific to VB6 and earlier versions.
ActiveX controls may give you issues related to not having a windows handle without a form but maybe not, I'm just guessing.
If you mean .NET controls then just declare and use it but what do you mean by events? What exactly are you trying to do?
I am just trying to create object (ie. textbox) programmatically and trigger the event (such as the keypress and change event handler) .. please advise ..
Thanks and Regards
Winanjaya
dunno if this helps
if not, sorry. :)VB Code:
Dim b As New Button() Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AddHandler b.Click, AddressOf b_click End Sub Sub b_click(ByVal sender As Object, ByVal e As EventArgs) MessageBox.Show("hello world") End Sub Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown If e.Control And e.KeyCode = Keys.B Then b_click(Me, Nothing) End If End Sub