Cycling and bicycle discussion forums. 
   Click here to join our community Log in to access your Control Panel  


Go Back   > >

Foo Off-Topic chit chat with no general subject.

User Tag List

Reply
 
Thread Tools Search this Thread
Old 02-05-08, 11:01 AM   #1
EJ123
'05 NUEser
Thread Starter
 
EJ123's Avatar
 
Join Date: Aug 2005
Bikes:
Posts: 3,370
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
I need help with VB.net

In a typical window on the GUI design tab, I made a few buttons on the bottom. Two of them are Clear and Close.

I have added a textbox, so if someone writes in something, and wants to clear it, they would click Clear. The thing is I forgot how to do that..or forgot the right coding.

I understand for close I write Me.Close().

Please help asap!



(I am using Visual Basic 2005 Express edition)
EJ123 is offline   Reply With Quote
Old 02-05-08, 11:03 AM   #2
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
The text box is a class and a variable of the main program (Me). So you probably have to do something like:

Me.MyTxtBox.Clear() or something along those lines.
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 11:10 AM   #3
EJ123
'05 NUEser
Thread Starter
 
EJ123's Avatar
 
Join Date: Aug 2005
Bikes:
Posts: 3,370
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
That worked KT. Also, in my text box on the actual GUI window, when the person adds his/her's name, and clicks submit, I need it say to say something like "thank you -insert name that was typed above here-"
I'm so confused. I guess I need some sort of variable? Dim name as string = "textbox.name" Heh.
EJ123 is offline   Reply With Quote
Old 02-05-08, 11:27 AM   #4
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by EJ123 View Post
That worked KT. Also, in my text box on the actual GUI window, when the person adds his/her's name, and clicks submit, I need it say to say something like "thank you -insert name that was typed above here-"
I'm so confused. I guess I need some sort of variable? Dim name as string = "textbox.name" Heh.
shouldn't be too hard....similar to above solution.

When they click submit, you could have something like:

Msgbox.show( "Thank you " & Me.MyTxtBox.gettext() )
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 11:29 AM   #5
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
The trick is....for every variable/data type you have, hit "." and see what functions are available to you. Moreso in dot net than ever before, almost everything you normally want to do is already done and ready for you to just call.

Alternatively use the MSDN help (if not local, then msdn.microsoft.com) to view each data type/class type and all the available functions/methods available.
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 11:29 AM   #6
Indy_Rider
Banned
 
Indy_Rider's Avatar
 
Join Date: Dec 2004
Location: On a boat
Bikes: 2000 Fisher Paragon, 2005 Giant OCR2, 2006 Bianchi SASS, numerous others
Posts: 56
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Indy_Rider is offline   Reply With Quote
Old 02-05-08, 11:36 AM   #7
EJ123
'05 NUEser
Thread Starter
 
EJ123's Avatar
 
Join Date: Aug 2005
Bikes:
Posts: 3,370
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Alrighty, and what about the Accept and Cancel form properties?

That is if the user presses Enter, it would work for the submit button, and I guess ESC would be Cancel?
EJ123 is offline   Reply With Quote
Old 02-05-08, 11:40 AM   #8
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by EJ123 View Post
Alrighty, and what about the Accept and Cancel form properties?

That is if the user presses Enter, it would work for the submit button, and I guess ESC would be Cancel?
Those may already be defaulted to work that way.....but I "think" (not 100% positive) that if you click the button on the GUI tab, down in the properties area there is something there that lets you assign keys to it.

You may have to look up more info on that though....haven't done that but once or twice and not in a long time.
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 11:44 AM   #9
EJ123
'05 NUEser
Thread Starter
 
EJ123's Avatar
 
Join Date: Aug 2005
Bikes:
Posts: 3,370
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by KingTermite View Post
Those may already be defaulted to work that way.....but I "think" (not 100% positive) that if you click the button on the GUI tab, down in the properties area there is something there that lets you assign keys to it.

You may have to look up more info on that though....haven't done that but once or twice and not in a long time.
Ohh. I remember that in class. I just can't remember where in the list it is. You know a ton about this.
EJ123 is offline   Reply With Quote
Old 02-05-08, 11:45 AM   #10
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Come to think of it....it might be on the properties of the main form, not the button. When you are in main form, "if <enter key pressed>, run button1()"....so check properties of main form. It's probably something like "keypress event" property or similar.
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 11:48 AM   #11
EJ123
'05 NUEser
Thread Starter
 
EJ123's Avatar
 
Join Date: Aug 2005
Bikes:
Posts: 3,370
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by KingTermite View Post
Come to think of it....it might be on the properties of the main form, not the button. When you are in main form, "if <enter key pressed>, run button1()"....so check properties of main form. It's probably something like "keypress event" property or similar.
I got it!

Also, when the user pushes clear, I need a label to appear above the textbox where they write. Right now I have a msgBox that comes up saying Input Cleared, but I think it would be better if it were to be just at the above label. Any ideas?
EJ123 is offline   Reply With Quote
Old 02-05-08, 11:48 AM   #12
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Try this little tutorial and see if it helps.

http://www.homeandlearn.co.uk/NET/nets10p3.html
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 11:49 AM   #13
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by EJ123 View Post
I got it!

Also, when the user pushes clear, I need a label to appear above the textbox where they write. Right now I have a msgBox that comes up saying Input Cleared, but I think it would be better if it were to be just at the above label. Any ideas?
Yes, you want a label for that.

Look in the label's functions and see if anything looks like it might work. (HINT, you want it to appear or not appear as the event happens).
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 11:54 AM   #14
EJ123
'05 NUEser
Thread Starter
 
EJ123's Avatar
 
Join Date: Aug 2005
Bikes:
Posts: 3,370
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Ok, got everything I needed. Thanks again for the help Can't thank you enough. I got to go get back to class now, heh.
EJ123 is offline   Reply With Quote
Old 02-05-08, 12:01 PM   #15
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Cheers bud.
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 12:02 PM   #16
mlts22 
Senior Member
 
Join Date: Aug 2006
Bikes:
Posts: 998
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Here is something I'm wondering:

VS .NET 2008 offers the ability to write code for three .NET versions, 2.0, 3.0 (which is pretty much 2.0 except for Vista and Server 2008 stuff), and 3.5.

What would be the best .NET version to build against?
mlts22 is offline   Reply With Quote
Old 02-05-08, 12:10 PM   #17
KingTermite 
On my TARDIScycle!
 
KingTermite's Avatar
 
Join Date: Jun 2005
Location: Eastside Seattlite Termite Mound
Bikes: Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
Posts: 3,924
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by mlts22 View Post
Here is something I'm wondering:

VS .NET 2008 offers the ability to write code for three .NET versions, 2.0, 3.0 (which is pretty much 2.0 except for Vista and Server 2008 stuff), and 3.5.

What would be the best .NET version to build against?
That's a tough question to answer because there are different goals and they sort of contradict each other.

If you want highest probability of compatibility, the older the better as not everybody updates their .Net framework (each can co-exist with other versions).

If you want most secure and/or best features available to you as a programmer, then probably the newest is the best choice.

I guess it depends on who your audience is. If you are writing something for yourself or at work where you KNOW you can control the configuration of the computer whatever you write will be run on, then I'd go with latest and greatest. If you are writing something to be deployed to "who knows where", then probably an older .NET framework version is better.

That's my $.02 worth.
__________________
Quote:
Originally Posted by coffeecake View Post
- it's pretty well established that Hitler was an *******.
KingTermite is offline   Reply With Quote
Old 02-05-08, 09:13 PM   #18
mlts22 
Senior Member
 
Join Date: Aug 2006
Bikes:
Posts: 998
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Thanks for the tip. Since .NET 3.5 is not even present on Windows Update (though easily findable by a search), I should just write against 3.0 for maximum compatibility.
mlts22 is offline   Reply With Quote
Old 02-05-08, 09:24 PM   #19
cuda2k
Unique Vintage Steel
 
cuda2k's Avatar
 
Join Date: May 2005
Location: Allen, TX
Bikes: Kirk Frameworks JKS-C, Serotta Nova, Gazelle AB-Frame, Fuji Team Issue, Schwinn Crosscut, All-City Space Horse
Posts: 11,486
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Quote:
Originally Posted by mlts22 View Post
Here is something I'm wondering:

VS .NET 2008 offers the ability to write code for three .NET versions, 2.0, 3.0 (which is pretty much 2.0 except for Vista and Server 2008 stuff), and 3.5.

What would be the best .NET version to build against?
I'm writing in 2.0 right now because that's what my webhost's servers are running. ie: boils down to what works best for your application.

Glad KT was able to help out with the questions. I haven't touched VB.NET in a while nor the application side of the Visual Studio. I've been doing all ASP.NET for quite a while.
cuda2k is offline   Reply With Quote
Old 02-05-08, 09:26 PM   #20
Malistryx
Senior Member
 
Malistryx's Avatar
 
Join Date: May 2007
Location: Aussieland
Bikes: Specialized Allez Sport, Jamis Dakota Comp
Posts: 73
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by cuda2k View Post
I haven't touched VB.NET in a while nor the application side of the Visual Studio. I've been doing all ASP.NET for quite a while.
To be fair ASP.Net apps can be written in either C# or VB.Net

Fortunately my company has mostly switched over to Ruby on Rails for our web apps, though I think we have a .Net 3.5 app coming up some time soon. That could be fun.
Malistryx is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



All times are GMT -6. The time now is 04:41 PM.