Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2006, 03:40 AM
Registered User
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Placing controls in containers at run time.


I need to place controls within an array of containers at run time. I've got as far as creating the arrays (of panels) but placing controls inside these panels has so far eluded me:(. Any useful clues or pointers, please.

Many thanks.

 
Old October 11th, 2006, 12:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Let's suppose you want to add a button called "cmd0" to a panel called "frame0":

Controls.Add("VB.CommandButton", "cmd0", frame0)
 
Old October 13th, 2006, 05:58 PM
Registered User
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks marcostraf :),

Very good pointer. The original sample I had found was so complex that I could not see the simplicty of it! This one works wonders.

All the best,
              HotBlue.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Controls At Run-Time robbev567 ASP.NET 2.0 Basics 2 July 25th, 2007 04:57 AM
Creating run time controls, manish_kaushik ASP.NET 2.0 Basics 1 February 10th, 2007 04:11 PM
Copying controls at run time aspadda Excel VBA 0 November 12th, 2003 01:07 PM
Adding controls at run-time !! kishore_peddi C# 0 October 13th, 2003 06:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.