borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (ActiveX  DLL)Next Topic (VB CallBack) New Topic New Poll Post Reply
AndreaVB Forum : ActiveX : Run-time Control Loading
Poster Message
CLialios
Level: Guest


icon Run-time Control Loading

I use the run-time loading control facility. I mean I do not mention a commandbutton in design time. How can I handle the events after loading this specific control? If for example its name is "player" and I write a player_Click() subroutine, no reply is going to take place when I click this button.

27-09-2003 at 08:56 PM
| Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Run-time Control Loading

Hi Clialios,
You need to route the events through a central location (i assume that you are using Controls.Add).
I suggest looking in the download section under controls, as I have put an example of this there.

Hope this helps,
Kieron

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

29-09-2003 at 12:05 PM
View Profile Send Email to User Show All Posts | Quote Reply
fabulous
Level: VB Guru


Registered: 03-08-2002
Posts: 439
icon Re: Run-time Control Loading

A simple way is to create a control array with one control at design time. Load the rest at run time and handle their events on the event handler. This is good if you don't know how many controls you could end up having.

You could also declare a WithEvents variable for player and that way the events will be handled.

____________________________
My boss is a Jewish Carpenter (Jesus Christ)


Brain Bench Certified VB.NET Developer

24-01-2004 at 06:35 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : ActiveX : Run-time Control Loading
Previous Topic (ActiveX  DLL)Next Topic (VB CallBack) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder