Click to See Complete Forum and Search --> : Creating forms at runtime
Gimpster
Nov 1st, 1999, 03:24 AM
Simply put, what I want to have is something that will work the same as the Data Form Designer in VB. I want to be able to create the form, create the text boxes and labels, and set all the properties. And it must all be based on user defined variables (such as: the fields they want displayed, what table to use, etc.) Please help, I know this is a huge task, but that's what I need.
------------------
Thanks,
Ryan
corneslen@hotmail.com
ICQ# 47799046
PhilipG
Nov 1st, 1999, 07:40 AM
It can be done, but not easily. The easier way to do this is have an create an array of an object and make its index 0. The other way involves much more code. I'd go with option 1 if you can.
Phil
Gimpster
Nov 3rd, 1999, 03:11 AM
What do you mean when you say "create an array"? I am interested in your idea, because I like the idea of little code. But could you please explain it better, I don't understand what you mean.
------------------
Thanks,
Ryan
corneslen@hotmail.com
ICQ# 47799046
Serge
Nov 3rd, 1999, 04:25 AM
What Philip is saying is not actually creating the form from scratch, but rather create another instance of the existing form.
Dim frm As New Form1
frm.Show
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
Gimpster
Nov 3rd, 1999, 04:55 AM
So what you mean is to create all the different possible forms at design time and then just show the form that fits what the user inputs as the criteria? Did I understand you correctly? Is that what you were saying?
------------------
Thanks,
Ryan
corneslen@hotmail.com
ICQ# 47799046
Luis Moises Rojas
Nov 4th, 1999, 12:39 AM
Well, I think you want something like this:
1. Create a form. 2. Create textbox
3. Insert data into the textbox and save them
if that is the point use this, after create the form as you know
DIM ctlWname as object
set ctlWname=frmForm.Controls.Add("VB.Textbox")
with ctlWname
. visible=true
.top= x 'Your top Position
.Left=x 'idem
.width=x 'idem
.height=x 'idem
.font.size= fx 'your font size
end with
Anyway this solution in on MICROPress Distributed Applications For Microsoft Visual Basic 6.0 MCSD Training Kit. ISBN 0-7356-0833-4
Serge
Nov 4th, 1999, 01:07 AM
Take a look at the Code snippet (http://www.vb-world.net/ubb/Forum1/HTML/009905.html) I posted for the similar question.
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.