|
-
Sep 27th, 2004, 11:26 PM
#1
Thread Starter
Fanatic Member
How to creating an instance of an ActiveX control without placing it on a form
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
-
Sep 28th, 2004, 01:21 AM
#2
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?
-
Sep 28th, 2004, 01:45 AM
#3
Thread Starter
Fanatic Member
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
-
Sep 28th, 2004, 02:03 AM
#4
Fanatic Member
dunno if this helps
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
if not, sorry.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|