I was wondering how to call an event for a dynamically created component. I have created a new form called “MyTestForm” using the forms designer. This form contains a single panel called “pnlTest”.
Then inside my solution code I have:
Sub Main(Client, GWEvent)
' Initialize a new dialog from my test form
gTestDlg = MyTestForm
' Create a dynamic component at run time
Set testEdit = TEdit.Create(gTestDlg.pnlTest)
.Parent = gTestDlg.pnlTest
.left = 50
.top = 10
.height = 21
.width = 160
.name = "edtTest"
.text = ""
.visible = true
.onClick = "testSub"
' Show the form
The edit box is created successfully, however the on click event does not get called. I have also tried a number of variations to the .onClick value attempting to pass in the sender variable, but I have not be able to get this event to be called.
Any thoughts on what I am doing wrong would be greatly appreciated.
[This message was edited by jasonchild on January 29, 2012 at 07:52 PM.]
- You must be logged in to reply to this topic.