dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Jan 11, 2000

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Copying Controls From Form to Form

Question:
I have a VB application that contains two forms. Form A is a Control Library that contains several Frames, Labels, Text Boxes, and Command buttons. (Note: some of these controls are third party controls.) Form B is the Main form. This form contains an SSActiveTab, with 4 tabs on it.

What I want to do is make it so that the user selects on tab 1, building a data entry form on tab 2. I know how to collect the desired controls from the Control Library, but how do I paint them onto the Main form tab?

Answer:
In VB6 a Form has a Controls collection which you can add to by passing the progid of the control. If you want to add a control that is not in the control box of the application and you want be able to catch events of the control, then declare a variable as VBControlExtender and set it to point to the control that you added:

Dim objNewControl as VBControlExtender

Set objNewControl=Controls.Add   ("Widget.Thingjet","Widget1")
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date