Do a call from a dynamically created button?

  • Thread starter Thread starter Gary Kahrau
  • Start date Start date
G

Gary Kahrau

If I create a form dynamically, is there some way I can point to a dll
function/ sub when the dynamic button is pushed?

Or do something like this.

dim DynSub as string
DynSub = "DoItSub" <== Value will come from the dynamic loader.
Call DynSub.


-----------------------------------------------------------
Gary Kahrau - VP Technology
(e-mail address removed) (W)
(e-mail address removed) (H)
Stellex Monitor Aerospace Corp.
-----------------------------------------------------------
 
You can use the function CallByName, or a Delegate function:

Sub Test()
CallByName Me, "DoItSub",... (other params)
End Sub

Sub DoItSub()
....
End Sub

- OR -

Private Delegate Sub DotItType()

Sub Test()
Dim d as New DoItType(AddressOf DoItSub)
d.Invoke()
End Sub

Sub DoItSub()
....
End Sub

HTH,
Jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top