This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Pasting into MaskedEdit control
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Feb 23, 2008
10:00 PM
Pasting into MaskedEdit control
I have a Basic MSI project. In my CustomerInformation dialog, I have a MaskedEdit control for the serial number, and I set the mask to
<^^^^=^^^^=^^^^>
If I copy 01234-56789-ABCDE to the clipboard and paste it into the MaskedEdit control, only the first section of it gets pasted. That is, only 01234 gets pasted into the control.
Is there a way I can paste a whole serial number into the MaskedEdit control so that all the fields of the control are filled out? We've had complaints about this for a long time, and marketing really wants to fix it.
Any help would be greatly appreciated.
Thanks,
loralynne
<^^^^=^^^^=^^^^>
If I copy 01234-56789-ABCDE to the clipboard and paste it into the MaskedEdit control, only the first section of it gets pasted. That is, only 01234 gets pasted into the control.
Is there a way I can paste a whole serial number into the MaskedEdit control so that all the fields of the control are filled out? We've had complaints about this for a long time, and marketing really wants to fix it.
Any help would be greatly appreciated.
Thanks,
loralynne
(2) Replies
‎Feb 27, 2008
11:29 AM
loralynne,
The way I had to do something like this in the past is to detect the paste operation, remove the mask, allow the paste then reapply the mask. I noticed your mask had equal signs(=) but the paste had dashes(-). You will have to parse your buffer for any non-numeric characters then paste the parsed string to the field and apply the mask.
This is not an easy or straight forward fix. You may want to use a textbox and write your own code for validation instead.
Cheers,
ME
The way I had to do something like this in the past is to detect the paste operation, remove the mask, allow the paste then reapply the mask. I noticed your mask had equal signs(=) but the paste had dashes(-). You will have to parse your buffer for any non-numeric characters then paste the parsed string to the field and apply the mask.
This is not an easy or straight forward fix. You may want to use a textbox and write your own code for validation instead.
Cheers,
ME
‎Feb 27, 2008
11:41 AM
Thanks for your reply ME! I was hoping there would be a easy straightforward fix. Oh well. 😞
FYI - The = is actually the field terminator. From http://msdn2.microsoft.com/en-us/library/aa369797.aspx: "This must follow a #, %, ^, or `. This creates one more input position of the same type as the preceding positions and terminates the field with a '-' separator."
Thanks again,
loralynne
FYI - The = is actually the field terminator. From http://msdn2.microsoft.com/en-us/library/aa369797.aspx: "This must follow a #, %, ^, or `. This creates one more input position of the same type as the preceding positions and terminates the field with a '-' separator."
Thanks again,
loralynne