[Gambas-user] Maskbox mask & text entry

Benoît Minisini gambas at ...1...
Thu Mar 19 19:15:37 CET 2015


Le 19/03/2015 18:29, John Rose a écrit :
> On 18/03/15 11:30, John Rose wrote:
>> I have a Maskbox with mask [A-Za-z][A-Za-z]. I noticed that the IDE
>> does not show the MaxLength property. I want the user to be able to
>> enter lower case & have the entry displayed as upper case for either
>> of the 2 characters. When I run the attached Test app, it only seems
>> to allow the entry of 1 characted. When 'a' followed by 'd' is
>> entered, the Maskbox displays D and the Console shows from the Print
>> statements carried out by code conversion of lower case to uppercase:
>> SteckerMaskBox.MaxLength=0
>> SteckerMaskBox.Length=1
>> SteckerMaskBox.Text=a
>> SteckerMaskBox.Mask=[A-Za-z][A-Za-z]
>> Length=1
>> SteckerMaskBox.MaxLength=0
>> SteckerMaskBox.Length=1
>> SteckerMaskBox.Text=d
>> SteckerMaskBox.Mask=[A-Za-z][A-Za-z]
>> Length=1
>>
>> What is the solution to allow a 2 character entry?
>>
>> PS I'm using Gambas Stable Builds ppa with gambas version showing as
>> 3.7.90 though Gambas IDE Title bar shows DEVELOPMENT VERSION - USE AT
>> YOUR OWN RISK. Could this 'Stable' ppa contain a jinxed Gambas version?
>>
>> --
>>
>> John
>>

Actually by setting the text in the Change event, you are prevent the 
MaskBox to work correctly.

MaskBox is not really useful for dealing with that kind of text entry. 
You should implement what you need with a TextBox.

Regards,

-- 
Benoît Minisini




More information about the User mailing list