Create a Form in Runtime in Visual Basic 6.0

How can i create a form in runtime and save it in visual baic 6.0

Page 1 of 1

5 Replies - 37472 Views - Last Post: 03 May 2010 - 09:11 AM Rate Topic: -----

#1 ritesh664  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-March 08

Create a Form in Runtime in Visual Basic 6.0

Posted 02 March 2008 - 11:49 AM

how can i create a form in runtime in visual basic 6.0. I have no code because i don't know how to create this form. I want the form is create automatically as like form create by DataManager option in Visual Basic 6.0. Please someone help me for this topic ?

This post has been edited by ritesh664: 02 March 2008 - 11:51 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Create a Form in Runtime in Visual Basic 6.0

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: Create a Form in Runtime in Visual Basic 6.0

Posted 02 March 2008 - 12:24 PM

What kind of form are you referring to? A VB 6 form or an actual printed form that people fill out? If you are talking about a VB 6 form then all you need to do is....

1) Add a form to your project (right click the folder in your project tree menu and select "Add" and then a window will appear and choose form. This will result in a new form being added called "form2")

2) In Form1 add a button and in the event you just need....

Private Sub Command1_Click()
    Form2.Show
End Sub



This tells VB to show the second form called Form2 using the show method.

Now if you are talking about actual forms that people fill out, you will need something like Crystal Reports to add into your project as a control and create a report through the designer window. Look up Crystal reports documentation online (I think Crystal reports 9 will be a good choice for VB 6).

I hope that answered your question.
Was This Post Helpful? 0
  • +
  • -

#3 jatsum321  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-November 09

Re: Create a Form in Runtime in Visual Basic 6.0

Posted 08 November 2009 - 12:15 PM

View PostMartyr2, on 2 Mar, 2008 - 11:24 AM, said:

What kind of form are you referring to? A VB 6 form or an actual printed form that people fill out? If you are talking about a VB 6 form then all you need to do is....

1) Add a form to your project (right click the folder in your project tree menu and select "Add" and then a window will appear and choose form. This will result in a new form being added called "form2")

2) In Form1 add a button and in the event you just need....

Private Sub Command1_Click()
    Form2.Show
End Sub



This tells VB to show the second form called Form2 using the show method.

Now if you are talking about actual forms that people fill out, you will need something like Crystal Reports to add into your project as a control and create a report through the designer window. Look up Crystal reports documentation online (I think Crystal reports 9 will be a good choice for VB 6).

I hope that answered your question.



he said... the program during in the runtime phase it will create a form....
Was This Post Helpful? 0
  • +
  • -

#4 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Create a Form in Runtime in Visual Basic 6.0

Posted 08 November 2009 - 01:54 PM

hi there :)

it is easy to create a form at designview and use (not use ) them. Even if you create a from at runtime it will be blank. No buttons no textboxes etc. creating then at run time and repositioning them will be much more trouble. Why do you need to create a from at runtime any way :)

good luck :)
Was This Post Helpful? 0
  • +
  • -

#5 Guest_De Sales Yordi*


Reputation:

Re: Create a Form in Runtime in Visual Basic 6.0

Posted 03 May 2010 - 08:38 AM

View Postritesh664, on 02 March 2008 - 10:49 AM, said:

how can i create a form in runtime in visual basic 6.0. I have no code because i don't know how to create this form. I want the form is create automatically as like form create by DataManager option in Visual Basic 6.0. Please someone help me for this topic ?


Same as Control Runtime Array Creation, Your Form Will Also Be Setted As Index or a MDChild

1. Create a control array of the control type you wish to create at runtime. If you want to create a textbox at runtime, create a Textbox control array. If you want to create a Command Button, create a Command Button Control array. Remember, to create a Control Array, all you need to do is to change the Index property of the control to something other than its default empty value.

2. Use the Load Statement, with a unique Index property, to create the new control.

3. Change the Visible property of the new control to True in order to make it visible.

4. Change the coordinate properties (Left or Top) to bring the new control out from under the original.

Load Check1(1)

Check1(1).Caption = "New Checkbox"

Check1(1).Visible = True

Check1(1).Top = Check1(0).Top + Check1(0).Height


http://www.vbexplore...0/april2000.asp
Was This Post Helpful? 0

#6 Guest_De Sales Yordi*


Reputation:

Re: Create a Form in Runtime in Visual Basic 6.0

Posted 03 May 2010 - 09:11 AM

View Postritesh664, on 02 March 2008 - 10:49 AM, said:

how can i create a form in runtime in visual basic 6.0. I have no code because i don't know how to create this form. I want the form is create automatically as like form create by DataManager option in Visual Basic 6.0. Please someone help me for this topic ?


Same as Control Runtime Array Creation, Your Form Will Also Be Setted As Index or a MDChild

1. Create a control array of the control type you wish to create at runtime. If you want to create a textbox at runtime, create a Textbox control array. If you want to create a Command Button, create a Command Button Control array. Remember, to create a Control Array, all you need to do is to change the Index property of the control to something other than its default empty value.

2. Use the Load Statement, with a unique Index property, to create the new control.

3. Change the Visible property of the new control to True in order to make it visible.

4. Change the coordinate properties (Left or Top) to bring the new control out from under the original.

Load Check1(1)

Check1(1).Caption = "New Checkbox"

Check1(1).Visible = True

Check1(1).Top = Check1(0).Top + Check1(0).Height


http://www.vbexplore...0/april2000.asp
Was This Post Helpful? 0

Page 1 of 1