Advertise on Bikeforums.net



User Tag List

Results 1 to 20 of 20
  1. #1
    '05 NUEser EJ123's Avatar
    Join Date
    Aug 2005
    Posts
    3,374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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)

  2. #2
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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 *******.

  3. #3
    '05 NUEser EJ123's Avatar
    Join Date
    Aug 2005
    Posts
    3,374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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.

  4. #4
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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 *******.

  5. #5
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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 *******.

  6. #6
    Banned Indy_Rider's Avatar
    Join Date
    Dec 2004
    Location
    On a boat
    My Bikes
    2000 Fisher Paragon, 2005 Giant OCR2, 2006 Bianchi SASS, numerous others
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    '05 NUEser EJ123's Avatar
    Join Date
    Aug 2005
    Posts
    3,374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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?

  8. #8
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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 *******.

  9. #9
    '05 NUEser EJ123's Avatar
    Join Date
    Aug 2005
    Posts
    3,374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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.

  10. #10
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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 *******.

  11. #11
    '05 NUEser EJ123's Avatar
    Join Date
    Aug 2005
    Posts
    3,374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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?

  12. #12
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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 *******.

  13. #13
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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 *******.

  14. #14
    '05 NUEser EJ123's Avatar
    Join Date
    Aug 2005
    Posts
    3,374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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.

  15. #15
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers bud.
    Quote Originally Posted by coffeecake View Post
    - it's pretty well established that Hitler was an *******.

  16. #16
    Senior Member
    Join Date
    Aug 2006
    Posts
    998
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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?

  17. #17
    On my TARDIScycle! KingTermite's Avatar
    Join Date
    Jun 2005
    Location
    Eastside Seattlite Termite Mound
    My Bikes
    Trek 520, Trek Navigator 300, Peugeot Versailles PE10DE
    Posts
    3,928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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 *******.

  18. #18
    Senior Member
    Join Date
    Aug 2006
    Posts
    998
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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.

  19. #19
    Unique Vintage Steel cuda2k's Avatar
    Join Date
    May 2005
    Location
    Allen, TX
    My Bikes
    Kirk Frameworks JKS-C, Serotta Nova, Gazelle AB-Frame, Fuji Team Issue, Schwinn Crosscut, All-City Space Horse
    Posts
    11,487
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(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.
    [CENTER][URL="http://VeloBase.com"][IMG]http://velobase.com/App_Themes/VeloBase2_blue/Images/VeloBase2TitleCampagnolo.jpg[/IMG][/URL][/CENTER]
    [CENTER][URL="http://JonPFischer.com"][COLOR="#006400"]Fischer Photography[/COLOR][/URL] - [URL="http://www.bikeforums.net/showthread.php/785462-My-new-modern-quot-Classic-quot-Kirk-JKS-Classic-Terraplane"][COLOR="#8b0000"]Kirk Frameworks JKS-Classic Build Thread[/COLOR][/URL][/CENTER]

  20. #20
    Senior Member Malistryx's Avatar
    Join Date
    May 2007
    Location
    Aussieland
    My Bikes
    Specialized Allez Sport, Jamis Dakota Comp
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •