请教高手级人物,菜鸟勿扰
有关在dll中动态向主程序窗体加载控件的问题
dll中类名ClsTest 工程名MyTest
dim withevents objCmd as VB.CommandButton
public sub Init(frm as Form)
set objCmd=form.controls.add("VB.CommandButton","objCmd").
ojcmd.visible=true
end sub
在dll中写
sub objCmd_CLick()
msgbox "testing"
end sub
编译为MyTest.dll
然后另开一工程调用这个dll
主程序:
添加一Form窗体。一按钮CommandButton1
private Sub CommandButton_Click()
dim aa as object
set aa=createobject("MyTest.dll")
aa.init me
end sub
问题: 添加的按钮的单击事件没有响应,就是没有弹出testing消息。