Is that a blank in your TextBox ...

Discussion in 'Microsoft VB .NET' started by eBob.com, Apr 21, 2010.

  1. eBob.com

    eBob.com Guest

    .... or are you glad to see me? (Sorry, an oblique reference to an old Mae
    West line.)

    But seriously ... sometimes a blank in a TextBox means something very much
    different than nothing in the TextBox, but there is no visual clue to the
    end user which permits him to distinguish between the two cases - that I
    know of. So that's my question. Is there anything I can do with a standard
    TextBox which would make it visually obvious whether a string ended with the
    last visible character or had some number of trailing blanks?

    I suppose I can develop my own class which inherits from TextBox and pad the
    string on the right with some character which can't easily be entered and
    which the end user should have no reason to use. But I also suspect that
    this will get somewhat messy before it works to my satisfaction. So ... any
    ideas?

    Thanks, Bob
     
    eBob.com, Apr 21, 2010
    #1
    1. Advertisements

  2. You can start looking what the masked textbox can do for you.


    "eBob.com" <> wrote in message
    news:...
    > ... or are you glad to see me? (Sorry, an oblique reference to an old Mae
    > West line.)
    >
    > But seriously ... sometimes a blank in a TextBox means something very much
    > different than nothing in the TextBox, but there is no visual clue to the
    > end user which permits him to distinguish between the two cases - that I
    > know of. So that's my question. Is there anything I can do with a
    > standard TextBox which would make it visually obvious whether a string
    > ended with the last visible character or had some number of trailing
    > blanks?
    >
    > I suppose I can develop my own class which inherits from TextBox and pad
    > the string on the right with some character which can't easily be entered
    > and which the end user should have no reason to use. But I also suspect
    > that this will get somewhat messy before it works to my satisfaction. So
    > ... any ideas?
    >
    > Thanks, Bob
    >
     
    Cor Ligthert[MVP], Apr 21, 2010
    #2
    1. Advertisements

  3. eBob.com wrote:
    > But seriously ... sometimes a blank in a TextBox means something very
    > much different than nothing in the TextBox, but there is no visual
    > clue to the end user which permits him to distinguish between the two
    > cases - that I know of. So that's my question. Is there anything I
    > can do with a standard TextBox which would make it visually obvious
    > whether a string ended with the last visible character or had some
    > number of trailing blanks?


    If you select all the text in the box then trailing blanks would be
    highlighted.

    --
    Andrew
     
    Andrew Morton, Apr 22, 2010
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daren Hawes
    Replies:
    2
    Views:
    607
    Cor Ligthert
    Jul 27, 2004
  2. Luqman
    Replies:
    2
    Views:
    1,111
    Luqman
    Jan 2, 2006
  3. Pieter
    Replies:
    1
    Views:
    268
  4. Rob W
    Replies:
    0
    Views:
    426
    Rob W
    Mar 6, 2009
  5. Derrick Candler

    TextBox to Array, Array Displayed in Textbox

    Derrick Candler, Sep 25, 2011, in forum: Microsoft VB .NET
    Replies:
    0
    Views:
    716
    Derrick Candler
    Sep 25, 2011
Loading...

Share This Page