PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: CMaskedEdit  (Read 1285 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9389
  • Windows 10
    • PlanetSquires Software
« on: November 01, 2018, 02:05:08 PM »

I have the new MaskedEdit control integrated into WinFBE but I am/was a little confused about the SetText documentation.

bSetMaskedCharsOnly Set the masked characters only, without the input mask.

Unless I am interpreting the documentation incorrectly, setting bSetMaskedCharsOnly to TRUE means that you would pass a string using only the mask characters without the input mask (eg. "5551119999"). If set to FALSE then you would also pass the Input Mask (eg. "(555) 111-9999").

However, in operation the logic appears to work the exact opposite. In order to work, SetText("5551119999", FALSE) or SetText("(555) 111-9999", TRUE).

Am I right? Wrong? Documentation error?

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Moderator
  • Guru Member
  • *****
  • Posts: 3326
Re: CMaskedEdit
« Reply #1 on: November 01, 2018, 03:09:44 PM »

Well, my poor attempt was to mean that in

pMskEd.EnableMask(" ddd  ddd dddd", "(___) ___-____", "_")
pMskEd.SetText("(123) 123-1212"), TRUE

where " ddd  ddd dddd" are the masked characters and "(___) ___-____" the input mask, passing true to that parameter will cause to set only the numbers (the masked characters) without the () and -, that correspond to the input mask.

But because there is a "mask" and "masked characters", I don't know how to explain it better.

With the EnableMask method, both the masked characters and the input mask are mandatory, and must be the same length.
« Last Edit: November 01, 2018, 03:14:34 PM by Josť Roca »