|
-
May 5th, 2005, 12:02 AM
#1
Thread Starter
Frenzied Member
Dynamically added controls-A Quick Question
Hi!
Just lost my mind today...
How do we attach an event handler to controls which are added dynamically through Controls Collection... ..
-
May 5th, 2005, 12:08 AM
#2
Re: Dynamically added controls-A Quick Question
You mean like using the ...
VB Code:
Public WithEvents SomeObject As ThatObject
In the General Declarations section.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 5th, 2005, 12:14 AM
#3
Thread Starter
Frenzied Member
Re: Dynamically added controls-A Quick Question
 Originally Posted by RobDog888
You mean like using the ...
VB Code:
Public WithEvents SomeObject As ThatObject
In the General Declarations section.
not exactly...
i don't know how many controls are added at runtime...
-
May 5th, 2005, 12:16 AM
#4
Re: Dynamically added controls-A Quick Question
Well you could make them a control array. One procedure for each type of control. Then you can use the UBound and
Index to determine how many?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 5th, 2005, 12:19 AM
#5
Fanatic Member
Re: Dynamically added controls-A Quick Question
Hi,
This thread may be of interest -
Dynamic event handling
-
May 5th, 2005, 03:17 AM
#6
Thread Starter
Frenzied Member
Re: Dynamically added controls-A Quick Question
 Originally Posted by RobDog888
Well you could make them a control array. One procedure for each type of control. Then you can use the UBound and
Index to determine how many?
No Control arrays.. i don't want to create one control for every type in design time...
-
May 5th, 2005, 03:19 AM
#7
Thread Starter
Frenzied Member
Re: Dynamically added controls-A Quick Question
 Originally Posted by RobCrombie
Thanx Rob...
but this wudn't be suitable for me.. as i never know. which type of control is being added at run time... type is also decided on the fly. so i cannot declare with WithEvents... because WithEvents requires the type..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|