Dynamically Creating Controls and Forms at runtime - HELP!!!! 
Author Message
 Dynamically Creating Controls and Forms at runtime - HELP!!!!

I am currently looking for information on how to create both forms and controls dynamically at runtime. This
basically is a recreation of the editor screen fo VB. Having run through both the manuals and the MSDN
Knowlege base the only part solutions I have found are the following

Have a blank form created in the project ie Form1.
Put one control of each dynamic type onto the form and make those controls invisible
When requesting a new control use the NEW key word on one of the hidden controls. This allows a dynamic
control array to be created holding each control

Use C/C++ to create the routines to draw the boxes and call them from VB

Is this the only way around the problem as I feel it seems to be a bit of a sneaky method and could use up a
fair amount of resources.

I am using 32 VB 4 under Windows '95.

Slainte Mhath

Shaun



Sun, 23 May 1999 03:00:00 GMT  
 Dynamically Creating Controls and Forms at runtime - HELP!!!!



Quote:
> I am currently looking for information on how to create both forms and

controls dynamically at runtime.

don't know about the C++ bits, but attached are a form and a proc file from
one of my little apps, it's not commented and please don't berate me for
any bad coding or whatever - the thing is still in a state of development.

I haven't included all the code, nor the rest of the files but you should
be able to get an idea of what's going on.
Basically the calling form runs GenForm which in turn creates a new
instance of the Generic form which in turn goes and gets the info it needs
to build the relevant controls by looking at the layout of the given
database table. Each of the source controls is the first of a control array
- this is the important bit. By LOADing each control as a template VB can
then create a new instance with the properties specified.

I got the info I needed to do this from Visual Basic Magazine (April 96) -
can't remember the author.

Hope this helps you as much as it did me..........

--
Chris Ashton
Applications Design Analyst

iQ Computing Limited, Uk
begin 600 frmGeneric.frm
<uuencoded_portion_removed>

`
end

begin 600 frmGeneric.frx
<uuencoded_portion_removed>
$97AT`&5S
`
end

begin 600 GenMod.bas
<uuencoded_portion_removed>

`
end



Sun, 23 May 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Can I dynamically(runtime) create a form/control?

2. Create a new form dynamically at runtime via strFormName

3. Create a new form dynamically at runtime via strFormName

4. deleting dynamically created controls in runtime using vb.net

5. Dynamically Creating Controls at Runtime

6. HELP: Dynamically Creating an enumerating Menu Items during Runtime

7. Dynamically adding a custom control to a form during runtime

8. Dynamically adding controls to a form at runtime

9. Creating Controls dynamically in Windows Forms

10. Creating controls on forms dynamically

11. How to dynamically create control on the form?

12. Dynamically creating controls (label, textbox...) on a form

 

 
Powered by phpBB® Forum Software