No ComboBox Mask?

I just noticed there’s no mask option for combobox text fields.

Anyone have any examples of how they’re handling this?

why do u need a mask for combobox??

[quote=185786:@Richard Brown]I just noticed there’s no mask option for combobox text fields.

Anyone have any examples of how they’re handling this?[/quote]

If you want Mask, you got to do it in Keydown. But it is kind of a hassle. Would it not be easier to do Format, by applying the format in the LostFocus event ?

For exactly the same reasons one might want one in a textbox - to prevent erroneous input.

Thank you for your suggestion Michel.

I am intrigued as to the rationale behind this being missing though.

I got it.

  • Place a TextField exactly on top of the textfield part of the Combobox
  • In the Textfield events :

Sub Open() me.mask = "(###) ###-####" End Sub

Sub TextChange() Combobox1.text = me.text End Sub

In the Combobox events :

Sub GotFocus() TextField1.setfocus End Sub

Sub TextChanged() Textfield2.Text = me.text End Sub

That way you benefit from the TextField mask.

As for the missing property in Combobox, no idea, but it may be time to create a feature request.

You can apply a mask to the combobox on Windows using API and the combobox handle. For Mac, I’d have to investigate the APIs to find the equivalent, but there should be one.