Results 1 to 9 of 9

Thread: txtbox strings

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    txtbox strings

    When I debug my application and look at the value of a txtbox and there's nothing in there it says:

    txtbox.text = ""


    but when I fire through the app a second time and there still is nothing in the txtbox, it says:


    txtbox.text = " "

    I do have the maxlength = 5....is there a way to keep the value "" , if nothing is placed in the txtbox?
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: txtbox strings

    txtbox.text = nothing would result the same thing I guess have you tried this?

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    arrrg....no it still reads it as having a value...I've tried txtbox.text = "" and txtbox.text = Nothing....anyone know why it puts in the spaces after the second time around?
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  4. #4
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I would verify that you are not changing the txtBox.Text property of the text box. Lots of people use txtBox.Text = "", so maybe on of these is actually txtBox.Text = " ".

    I am sure you verified this, but just in case...

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You can also use the trim method to take all spaces away... although I don't know why it is showing up like it is for you in the first place.

  6. #6
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I couldnt reproduce the problem. It always shows "" when nothing is there in the textbox.would you please send the code?
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  7. #7
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Yes, please post the code so we can take a look...

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by VBCrazyCoder
    Yes, please post the code so we can take a look...
    Is the textbox property set to this value at the generated form code ? and I can see any problems in this case , you can set the textbox to null before you start using it if is it possible in your case.

    Me.TextBox1.Text=""

  9. #9

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    I do have the txtbox.maxlength value set to 5.....I'll attach some code a little later...
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

Posting Permissions

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



Click Here to Expand Forum to Full Width