Masked TextBox

.net Albania
  • 13 years ago
    Hi, I'm tryin to do masked textbox in vb.net 2003, any idea please help
  • 13 years ago

    There isn't such item in toolbox? I do not know, I use vb express 2005

  • 13 years ago

    HI for everyone who is interested about masked textbox in vb.net 2003 I found the way, code is:

    dim dbl1 as double = "1234567890"
    dim str as string = dbl1.tostring.format("(###) - ### ####:)

    this will return:

    (123) - 456 7890

    Regards!!!

  • 13 years ago

    That's hardly a masked text box because there's no mask.  There are numerous third-party implementations of masked text boxes around, or you can use the ActiveX version from Microsoft.  You can add it to your toolbox from the COM Components tab and then use it like any other control, although it is a bit kludgier to use than a .NET control, as is often the case with ActiveX controls.

  • 13 years ago

    Couldn't you create one yourself?  Set up a psuedo-global variable (probably a bad idea, but it'd serve the purpose) and on the keypress event for that textbox concatenate the character to the end of the global variable and change the value to an * or something.

  • 13 years ago

    I am looking for the same Mask edit Textbox  for entering Date. I want to user to insert date in "dd/MM/yyyy" format.

    Chital Panchal

  • 13 years ago

    HI everyone, I have this done in my application here is the whole code:

    private sub textbox1_textchange ....
    if textbox1.text.length > 7 then
    dim myd as double = textbox1.text
    textbox1.text = myd.tostring("##/##/####")
    end sub



    this is for date for example if user enter 23052006 then this will return automatically 23/05/2006, but don't forget to make textbox properties to maxlength = 8.

     

  • 13 years ago

    Hii....

    Its working...but when anyone enters something different text, rather than digits or may be special characters, It shows an error. As well, it appends "/" character after

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only 3 numbers of interest to a computer scientist: 1, 0 and infinity”