|
-
Sep 16th, 2000, 11:35 PM
#1
Thread Starter
Fanatic Member
How can I create control eg a button on a form by pressing a button on another form?
I'm making a GUI editor for Powerbasic and the client form displays, and like in the VB IDE you click a botton and a button appears on that form, then I can click on the new button and drag it, resize it etc.
if I use Dim X as New CommandButton, how do I make it appear on form2 ???
Thanks
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Sep 17th, 2000, 12:13 AM
#2
Frenzied Member
Use Form2's controls collection and perform an Add command (Form2.Controls.Add) See MSDN for more details on the Controls collection and event trapping for these controls.
-
Sep 17th, 2000, 12:19 AM
#3
Thread Starter
Fanatic Member
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Sep 17th, 2000, 12:31 AM
#4
Hyperactive Member
Does a control array work also?
No time to try it out for you, but can you create a hidden button on Form2 with index property set to 0, then when creating a new one,
Code:
x=1
form2.load newButton(x)
newButton(x).visible=true
I think it will work fine - in fact I think I do this in a usercontrol I made.
Regards
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
|