MaskedTextBox and PromptChar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eljainc

    MaskedTextBox and PromptChar

    Hello,

    I am trying to utilize a MaskedTextBox control on my form. I would
    like the user to enter numbers only (i.e. 65000), I set the Mask
    property as 999999 and the PromptChar as space (it won't take a
    blank). However in my output the masked characters are replaced by
    spaces. How can I change this promptchar to a blank/empty value so
    that there are no spaces? Is there a more suitable control to use?

    Thanks
    Mike
  • Mr. Arnold

    #2
    Re: MaskedTextBox and PromptChar


    "eljainc" <eljainc@sbcglo bal.netwrote in message
    news:59d83b43-42cc-4cb4-b657-b8cd67a1d8f2@c6 5g2000hsa.googl egroups.com...
    Hello,
    >
    I am trying to utilize a MaskedTextBox control on my form. I would
    like the user to enter numbers only (i.e. 65000), I set the Mask
    property as 999999 and the PromptChar as space (it won't take a
    blank). However in my output the masked characters are replaced by
    spaces. How can I change this promptchar to a blank/empty value so
    that there are no spaces? Is there a more suitable control to use?
    >
    You can't use the MaskedTextBox.T ext.Trim() or some other string
    manipulation method for the control? You can even make-up a method like a
    String method named RemoveSpacesMTB ( ref MaskedTextBox ctrl), give the
    method the MaskedTextBox control, do string manipulation that way too off of
    ctrl.text.whate verstringmethod (), and return the manipulated string to the
    control.

    Comment

    Working...