Author |
Message |
Doug Ros #1 / 7
|
 Can I dynamically(runtime) create a form/control?
You can create forms and controls at runtime, but they must be defined at design time. Say you had a form that acted as a text editor. You can create any number of these forms at run time for an MDI text editor for example. Same with controls. You can create a single control and give it an index and create many more to create a control array at runtime. You cannot simply create a form or control out of nothing. Besides, there would be no code behind it and you can't add code at runtime... Try this: ' Create a form at design time called "Form1" Public frmMain As Form ' OR: Public frmMain As Form1 Private Sub Main() ' Create a new Form1 and show it: Set frmMain = New Form1 frmMain.Show ' ......... ' Destroy the Form1 pointed to by frmMain: Set frmMain = Nothing End Sub
Quote: > Hi, > Can I dynamically(at runtime) create a form or a control? > That is not in the design mode. > Also can I at runtime destroy a form or a control? > Not just making it Enabled:False, Visible:False, etc. > thanks
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
ADP #2 / 7
|
 Can I dynamically(runtime) create a form/control?
Glenn, VB6 introduced the ability to create controls 'out of thin air' at runtime. See dynamic control creation in the What's new section of MSDN for VB6. You can create forms, too, at runtime--even if they didn't exist at designtime--but you have to use native Windows functionality. See DevX (?) for an example. --A
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Glenn Ton #3 / 7
|
 Can I dynamically(runtime) create a form/control?
Hi, Can I dynamically(at runtime) create a form or a control? That is not in the design mode. Also can I at runtime destroy a form or a control? Not just making it Enabled:False, Visible:False, etc. thanks
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
res #4 / 7
|
 Can I dynamically(runtime) create a form/control?
'create a control with an index of 0 dim x as long for x=1 to NumOfControls load Control(x) control(x).enabled=true control(x).visible=true 'control(x).Left=Whatever 'control(x).Top=Whatever next x
Quote:
> > example. Same with controls. You can create a single control and give it > > an index and create many more to create a control array at runtime. You > Can you please give me some code to demostrate creating control array > at runtime, thanks.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Glenn Ton #5 / 7
|
 Can I dynamically(runtime) create a form/control?
Quote:
> example. Same with controls. You can create a single control and give it > an index and create many more to create a control array at runtime. You
Can you please give me some code to demostrate creating control array at runtime, thanks.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
JoKi #6 / 7
|
 Can I dynamically(runtime) create a form/control?
Quote:
>Glenn, >VB6 introduced the ability to create controls 'out of thin air' at runtime. >See dynamic control creation in the What's new section of MSDN for VB6.
Is this true? - I haven't found anything similar in the (german) documentation, but I'm very interested in this subject. Could you give me any more hints what to search for in the MSDN? Thanks in advance JoKi ----------------------------------------------------------- Got questions? Get answers over the phone at Keen.com. Up to 100 minutes free! http://www.keen.com
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Jim in Clevelan #7 / 7
|
 Can I dynamically(runtime) create a form/control?
Quote:
> >Glenn, > >VB6 introduced the ability to create controls 'out of thin air' > at runtime. > >See dynamic control creation in the What's new section of MSDN > for VB6. > Is this true? - I haven't found anything similar in the (german) > documentation, but I'm very interested in this subject. Could > you give me any more hints what to search for in the MSDN?
I don't know if the VB Help index translates directly auf Deutsch - in my English version, I find useful info in index under the topic: Controls collection or: Add method (controls collection) As with some VB Help doc's, this one doesn't tell you everything, but enough to get you started. -- Jim in Cleveland If you're writing to me, in my address change "REAL_Address.see.below" to "worldnet.att.net" ((("What's so funny 'bout peace, love & understanding?" - Nick Lowe)))
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
|