ComputerForum.com ComputerForum.com  
TigerDirect
 
Go Back   Computer Forum > General Chat > General Computer Chat

Reply
 
LinkBack Thread Tools Display Modes
Old 10-05-2007, 09:55 PM   #1 (permalink)
banned
 
Join Date: Feb 2007
Posts: 6,060
Default Create a TextBox clear button in VB?

I want to make a button in one of my programs that will clear all textboxes in the form, how do I do this? It's Visual Basic 2005 Express Edition...



Thanks
INTELCRAZY is offline   Reply With Quote


Old 10-06-2007, 12:25 AM   #2 (permalink)
Silver Member
 
wungoodshu's Avatar
 
Join Date: Sep 2007
Location: Philly
Age: 17
Posts: 126
Default

Make a button, program it to do...

Text1 = ""

Text1 being the name of the text box. Just make the list longer if you want the button to clear multiple text boxes.
wungoodshu is offline   Reply With Quote
Old 10-06-2007, 12:39 AM   #3 (permalink)
banned
 
Join Date: Feb 2007
Posts: 6,060
Default

Quote:
Originally Posted by wungoodshu View Post
Make a button, program it to do...

Text1 = ""

Text1 being the name of the text box. Just make the list longer if you want the button to clear multiple text boxes.
Okay thanks
INTELCRAZY is offline   Reply With Quote
Old 10-06-2007, 12:50 AM   #4 (permalink)
banned
 
Join Date: Feb 2007
Posts: 6,060
Default

How could I select between different forms? I don't even know how to make a program that uses two different Windows yet...
INTELCRAZY is offline   Reply With Quote
Old 10-06-2007, 07:49 AM   #5 (permalink)
Diamond Member
 
K3rupt's Avatar
 
Join Date: Aug 2006
Location: Australia
Age: 16
Posts: 1,386
Default

You create the Forms,

You know how to do this?

If Not:

Right Click your current Form (Default Top Left, Default Names is Form1)

Go to Add

Click Form

Then, You reference the form it is in in the Code window

Using

form2.txtbox1.text = ""

EG:

You create A Form:
With 2 cmd box's
and a text box

Create another form

One command box with clear the writing on its own form
The other command box will clear the writing on the Otherform

Now, Just do as i have done:
Try out the Code i have done.
I have done it differently too what you may want too do








You may have a cmd box that when clicked, brings up other form

This would be done using Form2.show

Easy
__________________
GigaByte K8N Nforce Pro-SLI
AMD 3800+ Socket 939
2048MB PC3200 DDR Matched RAM
960GB Hard Drive [3 x 320GB SataII Seagate's]
Albatron 8600GT 256MB *New. . .Too me*
21" ViewSonic LCD Monitor
6.3 Sound System
|Desktop| |Setup!| |Inside Computer| |Server| Updated Setup!
Check out My Banner!
When The Rich Wage War Its The Poor Who Die.
K3rupt is offline   Reply With Quote


Old 10-06-2007, 02:45 PM   #6 (permalink)
banned
 
Join Date: Feb 2007
Posts: 6,060
Default

Quote:
Originally Posted by K3rupt View Post
You create the Forms,

You know how to do this?

If Not:

Right Click your current Form (Default Top Left, Default Names is Form1)

Go to Add

Click Form

Then, You reference the form it is in in the Code window

Using

form2.txtbox1.text = ""

EG:

You create A Form:
With 2 cmd box's
and a text box

Create another form

One command box with clear the writing on its own form
The other command box will clear the writing on the Otherform

Now, Just do as i have done:
Try out the Code i have done.
I have done it differently too what you may want too do








You may have a cmd box that when clicked, brings up other form

This would be done using Form2.show

Easy
Yeah, Thanks, I could do that...

But I want to run like different forms that contain different things, so I want one form to be like a menu and use buttons to link into the other forms. How do I do this?

Thanks again
INTELCRAZY is offline   Reply With Quote
Old 10-06-2007, 11:42 PM   #7 (permalink)
Diamond Member
 
K3rupt's Avatar
 
Join Date: Aug 2006
Location: Australia
Age: 16
Posts: 1,386
Default

Quote:
Originally Posted by INTELCRAZY View Post
Yeah, Thanks, I could do that...

But I want to run like different forms that contain different things, so I want one form to be like a menu and use buttons to link into the other forms. How do I do this?

Thanks again
Do you know about all the ways too put the words in (hard to desribe)

Eg: you must call Command Buttons cmd(then the name here without brackets)

text box must be txt(name)

Labels must be lbl(name)



Just create the forms with what you want on them

Too refrence and item in another form to change its propertys, You must write the forms name, Then the item you wish to change its property, then the items itselfs property, then what you want too change it too.

Eg

form2.txtexample.text = "I am Not a Nub"


Or if you wanted like Radio Buttons on a different form changing something on the main form

Create how ever many radio (option) buttons you want on the form
Create the other items (for my example im using a text box)

Prime example

Main Form's name = Form1 (Containing the text box)
Other form's name = Form2 (containing 3 Radio Buttons, Not in an array)
textbox's name = txtchanged
Option button 1 name = Option1
option button 2 name = Option2
Option button 3 name = Option3

Ok.

What this program will do is When a radio button is clicked, it will change the propertys of another item on the other form.

Here you go:





__________________
GigaByte K8N Nforce Pro-SLI
AMD 3800+ Socket 939
2048MB PC3200 DDR Matched RAM
960GB Hard Drive [3 x 320GB SataII Seagate's]
Albatron 8600GT 256MB *New. . .Too me*
21" ViewSonic LCD Monitor
6.3 Sound System
|Desktop| |Setup!| |Inside Computer| |Server| Updated Setup!
Check out My Banner!
When The Rich Wage War Its The Poor Who Die.
K3rupt is offline   Reply With Quote
Old 10-07-2007, 12:24 AM   #8 (permalink)
banned
 
Join Date: Feb 2007
Posts: 6,060
Default

Quote:
Originally Posted by K3rupt View Post
Do you know about all the ways too put the words in (hard to desribe)

Eg: you must call Command Buttons cmd(then the name here without brackets)

text box must be txt(name)

Labels must be lbl(name)



Just create the forms with what you want on them

Too refrence and item in another form to change its propertys, You must write the forms name, Then the item you wish to change its property, then the items itselfs property, then what you want too change it too.

Eg

form2.txtexample.text = "I am Not a Nub"


Or if you wanted like Radio Buttons on a different form changing something on the main form

Create how ever many radio (option) buttons you want on the form
Create the other items (for my example im using a text box)

Prime example

Main Form's name = Form1 (Containing the text box)
Other form's name = Form2 (containing 3 Radio Buttons, Not in an array)
textbox's name = txtchanged
Option button 1 name = Option1
option button 2 name = Option2
Option button 3 name = Option3

Ok.

What this program will do is When a radio button is clicked, it will change the propertys of another item on the other form.

Here you go:






I just need a button to open another form, what do I code to do this?


Thanks
INTELCRAZY is offline   Reply With Quote
Old 10-07-2007, 04:03 AM   #9 (permalink)
Diamond Member
 
K3rupt's Avatar
 
Join Date: Aug 2006
Location: Australia
Age: 16
Posts: 1,386
Default

Quote:
Originally Posted by INTELCRAZY View Post
I just need a button to open another form, what do I code to do this?


Thanks
the forms name . show

so

form2.show
__________________
GigaByte K8N Nforce Pro-SLI
AMD 3800+ Socket 939
2048MB PC3200 DDR Matched RAM
960GB Hard Drive [3 x 320GB SataII Seagate's]
Albatron 8600GT 256MB *New. . .Too me*
21" ViewSonic LCD Monitor
6.3 Sound System
|Desktop| |Setup!| |Inside Computer| |Server| Updated Setup!
Check out My Banner!
When The Rich Wage War Its The Poor Who Die.
K3rupt is offline   Reply With Quote
Old 10-07-2007, 04:11 AM   #10 (permalink)
banned
 
Join Date: Feb 2007
Posts: 6,060
Default

Quote:
Originally Posted by K3rupt View Post
the forms name . show

so

form2.show
Nice Thanks...

Watch out I am working on a project... I might trouble you for more stuff
INTELCRAZY is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:48 PM.


Powered by: vBulletin Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright © 2002-2008 Computer Forum and Web Design Forum