Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 13th, 2006, 04:35 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default clearing out the form

hello all,

i am new to vb.net 2003, and need some help about a couple of things:
-i have a form with multiple controls on it(menus,toolbars,txtbx,labels,....), i need to clear the form from all the components and after it create, on the same form other components.
-i need to know how to use the progress bar control, timer control,and tabbed form control.(i looked into my book Begining Visual Basic .Net 2003 but didn't find(or missed,sorry) info about these)

i will google a little for the second question, but i appreciate any help or reply for the above.

  #2 (permalink)  
Old February 14th, 2006, 09:41 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

about the first one that really doesn't sound ok.. why cleaning up a form to make a new one?? why just not create a new one?? maybe more info about what are you trying to accomplish will give us a better perpective...

about the second, all the info you need is on the msdn under that controls...

HTH

Gonzalo
  #3 (permalink)  
Old February 14th, 2006, 01:34 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default

in the first question,clearing a form and generating new components, all i wanted to say is that if i have a form, and i dont want to create another new one,(i.e i want to reuse it),is there a way to clear it and generate new components at run time?
even if there is no way to do it, is it possible to generate new components at run time?

  #4 (permalink)  
Old February 14th, 2006, 01:43 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

ok.. you can do that.. but you will need all the controls (the old ones and the new ones) on the form. to load a control you need one control into an array of controls and use the load statement.

but you will have a lot of problems controling the events for the controls.

if you want to reuse code better put it in a module or even better on a class

to unload controls use the unload statement (but you will need one always loaded b/c you cannot create a control from nothing.)

feel free to keep asking :)

HTH

Gonzalo
  #5 (permalink)  
Old February 14th, 2006, 02:32 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default

i understand from the above that all the controls must be pre-made and stored into array and there will be problems. however the second idea sounds better, but sorry i didn't grasp it especially stuff between (), can you give me a little example(as one once said, an example worth 1000 words).
Thank you for your patience.

  #6 (permalink)  
Old February 14th, 2006, 02:42 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

oooooppppppsss.. sorry... im telling you the way VB 6 will loads controls.. let's restart...

be back to you in some minutes...

HTH

Gonzalo
  #7 (permalink)  
Old February 14th, 2006, 02:50 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default

ok tyt

  #8 (permalink)  
Old February 14th, 2006, 02:50 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

you can add controls to your form with something like this

(ex. that create a combo box)

Code:
Private Function CreateCB() As ComboBox 
    Dim cb As New ComboBox() 


    Me.Controls.Add(cb) 
    cb.Dock = DockStyle.Top 
    CreateCB = cb 
End Function
remember that you can add events to your new control to (i dont remeber the statement for that, but is not dificult).

hope this now help...

HTH

Gonzalo
  #9 (permalink)  
Old February 14th, 2006, 03:00 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default

ok thanks i will try this now, and reply to you if i had any problems.
btw what about positioning the control,suppose a label for example?(if you have a quick answer so be it, if not i am searching the net anyway)
thanks a lot.

  #10 (permalink)  
Old February 21st, 2006, 04:44 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default

hello again,
i have a somewhat similar question, what if after an application is ran, i want to restore it to its initial state, i.e. suppose a group of labels and text boxes and buttons were enabled,created written to etc..., i want after some event that the form returns to its initial state,i.e. when it first ran, could it be possible?(VB.Net 2003)
thanks in advance.



Similar Threads
Thread Thread Starter Forum Replies Last Post
clearing the form europhreak Dreamweaver (all versions) 1 September 18th, 2005 03:35 AM
Clearing a label in FORM LOAD sweet4511 VB How-To 2 July 19th, 2005 01:22 PM
register.php: clearing html form fields lamada BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 26th, 2004 01:25 PM
Clearing a Form jbenson001 ASP.NET 1.x and 2.0 Application Design 2 December 3rd, 2003 11:43 AM
Clearing values from form and ASP variables sniffer Classic ASP Basics 1 September 24th, 2003 02:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.