none
Change TextBox to MaskedTextBox RRS feed

  • Question

  • Since i dragged and dropped the fields of my Access table, all fields are TextBox, how can I change some of them to a MaskedTextBox so i can use it with a mask? (example: __/__/____)

    I tried deleting one of them and naming as the same as it was before, but it did'nt work...

    Every help is appreciated!

    • Moved by CoolDadTx Monday, November 9, 2015 5:57 PM Office related
    Saturday, November 7, 2015 5:37 PM

Answers

  • Hi belgvr,

    >> how can I change some of them to a MaskedTextBox so i can use it with a mask?

    To achieve your requirement, you could set InputMask property of TextBox. Open Property of TextBox, choose Data tab, and then enter “99/99/0000;” in Input Mask. You could change InputMask for your own requirement.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, November 10, 2015 2:37 AM
  • set the InputMask property of the textbox control.

    .1. Go to the design view of the form

    .2. turn on the Property Sheet if it is not showing (ALT-ENTER)

    .3. select the textbox control

    .4. click on the DATA tab of the Property Sheet

    .5. click in the InputMask property

    .6. click the builder button ... to the right to help you make the mask


    Warm Regards, Crystal http://www.AccessMVP.com/strive4peace * (: have an awesome day :)

    Tuesday, November 10, 2015 2:47 AM

All replies

  • Your question is so general, I can't even tell if you are on teh right Forum.

    Is this a C# project at all?
    What version of Visual Studio are you using?
    What is your code?
    What is happening or not happening? ("Didn't work" is not a usefull output)

    Asuming this is a WinForms project, MastkedTextBox and and TextBox are brothers (together with RichtTextBox) that inherit from TextBoxBase (a abstract base class)

    Saturday, November 7, 2015 5:55 PM
  • "dragged and dropped the fields of my Access table", are you using MS Access instead?

    If you are then post it here

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=accessdev&filter=alltypes&sort=lastpostdesc

    Go here if you want to do MaskedTextBox in C# winform

    https://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    chanmm


    chanmm

    Sunday, November 8, 2015 4:26 AM
  • Hello,

    For a Windows form project, open the Data Sources window, select the field you want to change to a MaskEditTextBox, a ComboBox should appear. Select Customize, select MaskEditTextBox. Now a MaskEditTextBox will be in the list, select it. Now drag that field to the form and there will be a MaskedEditTextBox placed on the form set to that field.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.
    Microsoft Developer tools
    Developer’s Guide to Windows 10 video series

    Sunday, November 8, 2015 2:26 PM
  • Hi belgvr,

    >> how can I change some of them to a MaskedTextBox so i can use it with a mask?

    To achieve your requirement, you could set InputMask property of TextBox. Open Property of TextBox, choose Data tab, and then enter “99/99/0000;” in Input Mask. You could change InputMask for your own requirement.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, November 10, 2015 2:37 AM
  • set the InputMask property of the textbox control.

    .1. Go to the design view of the form

    .2. turn on the Property Sheet if it is not showing (ALT-ENTER)

    .3. select the textbox control

    .4. click on the DATA tab of the Property Sheet

    .5. click in the InputMask property

    .6. click the builder button ... to the right to help you make the mask


    Warm Regards, Crystal http://www.AccessMVP.com/strive4peace * (: have an awesome day :)

    Tuesday, November 10, 2015 2:47 AM