Home Forums WinForms controls Other WinForms controls Overriding Wincombobox Mask

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18335 |

    Hello,

    I noticed that the Wincombobox Mask property is read only, unlike Wintextbox. Is there a way I can override this so I can set a mask (this is especially useful since the Wincombobox dropdown control cannot be overriden with a wincalendar, so my users don’t know what date format to input dates in to a combo box without a mask)? Can you show me a quick example?

    Thanks again for the great support.

    Imported from legacy forums. Posted by John (had 3108 views)

    Xceed Support
    Member
    Post count: 5658

    Since you cannot use the mask (read-only), you have 2 options:

    1) You could use the WinDatePicker. You can, after, use the EditFormatSpecifier to input a mask in the TextBoxArea.

    2) You can use a WinTextBox where you set the DropDownControl to a WinCalendar and add a button to the DropDownButton. You need to handle the DroppedDownChanged event the transfer the data selected from the WinCalendar to the TextBoxArea. That way, you will be able to use the mask on the TextBoxArea.

    <code>
    private void Form1_Load( object sender, EventArgs e )
    {
    winTextBox1.DroppedDownChanged += new EventHandler( winTextBox1_DroppedDownChanged );
    winTextBox1.TextBoxArea.Mask = “9999-99-99”;
    }

    void winTextBox1_DroppedDownChanged( object sender, EventArgs e )
    {
    if( !winTextBox1.DroppedDown )
    {
    winTextBox1.TextBoxArea.Text = winCalendar1.SelectedDate.ToShortDateString();
    }
    }
    </code>

    Imported from legacy forums. Posted by CharlesB (had 254 views)

    User (Old forums)
    Member
    Post count: 23064

    I’ve done this with WinTextBoxes and custom controls (implementing a WinCalendar), so since I can’t do it with WinComboBoxes, I guess I’ve got some major redesigning to do.

    Please consider a request to change this behavior to allow masks directly in WinComboBoxes.

    Thank you for your help.

    Imported from legacy forums. Posted by John (had 4151 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.