dmdb
New member
Hi all,
I'm having problems with an external activex control which I'm using for an application I've been asked to try and make work by my boss, this bit is going beyond my experience and google hasnt helped as much as it usually does!
I have an external control as mentioned which is dynamically created on the form at runtime as a variable number of them need to be running. The settings for each are read from an xml config file, thats fine and I can create them and they do what they're expected to do.
The problem is dealing with events from these controls, simple things such as mouse clicks and other custom events which the control has. I don't know how to create a function to handle these events, so for instance how I might (for arguments sake) fetch one of the controls tag when the mouse is clicked on on it.
In theory I know I can when the controls are created use AddHandler to do this but I constantly get errors saying that the signatures don't match which I can't get rid of.
I hope I've provided enough information, I've been using a dumbed down project (sans xml config and the rest of the app) just to try and build a working version first of all and am using the below to load the controls at the moment:
And then the below to try and fetch that click which doesnt work:
Hoping someone can give me some pointers for dealing with external controls as I've hit a real road block and would appreciate anything anyone can offer...
Many thanks,
DB
I'm having problems with an external activex control which I'm using for an application I've been asked to try and make work by my boss, this bit is going beyond my experience and google hasnt helped as much as it usually does!
I have an external control as mentioned which is dynamically created on the form at runtime as a variable number of them need to be running. The settings for each are read from an xml config file, thats fine and I can create them and they do what they're expected to do.
The problem is dealing with events from these controls, simple things such as mouse clicks and other custom events which the control has. I don't know how to create a function to handle these events, so for instance how I might (for arguments sake) fetch one of the controls tag when the mouse is clicked on on it.
In theory I know I can when the controls are created use AddHandler to do this but I constantly get errors saying that the signatures don't match which I can't get rid of.
I hope I've provided enough information, I've been using a dumbed down project (sans xml config and the rest of the app) just to try and build a working version first of all and am using the below to load the controls at the moment:
VB.NET:
For i As Integer = 0 To 5
Dim src As New acti.AxnvUnifiedControllib
src.Location = New Drawing.Point(8, 150 + i * 24)
src.TabIndex = i
src.Text = i.ToString
src.Tag = i.ToString
AddHandler src.Click, AddressOf srcClick
Controls.Add(src)
Next
And then the below to try and fetch that click which doesnt work:
VB.NET:
Private Sub srcClick(ByVal sender As Object, _
ByVal e As EventArgs)
MessageBox.Show("Clicked was " & _
DirectCast(sender, acti.AxnvUnifiedControllib).Tag.ToString)
End Sub
Hoping someone can give me some pointers for dealing with external controls as I've hit a real road block and would appreciate anything anyone can offer...
Many thanks,
DB