p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
I forgot my password Register Now
Register | FAQ | Members List | Calendar | 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old February 14th, 2006, 09:41 AM
Friend of Wrox
Points: 6,570, Level: 34
Points: 6,570, Level: 34 Points: 6,570, Level: 34 Points: 6,570, Level: 34
Activity: 42%
Activity: 42% Activity: 42% Activity: 42%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,000
Thanks: 5
Thanked 37 Times in 36 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old February 14th, 2006, 01:43 PM
Friend of Wrox
Points: 6,570, Level: 34
Points: 6,570, Level: 34 Points: 6,570, Level: 34 Points: 6,570, Level: 34
Activity: 42%
Activity: 42% Activity: 42% Activity: 42%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,000
Thanks: 5
Thanked 37 Times in 36 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old February 14th, 2006, 02:42 PM
Friend of Wrox
Points: 6,570, Level: 34
Points: 6,570, Level: 34 Points: 6,570, Level: 34 Points: 6,570, Level: 34
Activity: 42%
Activity: 42% Activity: 42% Activity: 42%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,000
Thanks: 5
Thanked 37 Times in 36 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #8 (permalink)  
Old February 14th, 2006, 02:50 PM
Friend of Wrox
Points: 6,570, Level: 34
Points: 6,570, Level: 34 Points: 6,570, Level: 34 Points: 6,570, Level: 34
Activity: 42%
Activity: 42% Activity: 42% Activity: 42%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,000
Thanks: 5
Thanked 37 Times in 36 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
clearing the form europhreak Dreamweaver (all versions) 1 September 18th, 2005 04:35 AM
Clearing a label in FORM LOAD sweet4511 VB How-To 2 July 19th, 2005 02: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 02: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 03:40 AM



All times are GMT -4. The time now is 01:49 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc