PC Review


Reply
Thread Tools Rate Thread

Re: Mask Edit Control. Does it exist?

 
 
tanwaiho@gmail.com
Guest
Posts: n/a
 
      17th Mar 2005
Hi Chris,
I was looking for a masked editbox on the web when I chance upon your
entry. Would it be possible for you to email me your control too?
Thanks in advance.

Dylan.

chris-s wrote:
> I've got one I can email you if you wish.
>
> Chris.
>
>
> "n2alexan" <(E-Mail Removed)> wrote in message
> news:4d7d01c325f6$e6123000$(E-Mail Removed)...
> > Hi,
> > I am looking for a mask Edit control to validate user
> > entry.
> > I want the user to be able to enter number with specified
> > decimal places after the point.
> > I have managed to use Regular Expression and Text Box to
> > validate the entry. However, Mask Edit Control would be an
> > ideal solution. Does this control exits in CF? Or could
> > anyone give an advise where I can find customised text box
> > control.
> > thank you
> > Nataliya


 
Reply With Quote
 
 
 
 
Darren Shaffer
Guest
Posts: n/a
 
      17th Mar 2005
A simple way to add basic masked-edit features to your CF controls is to
edit the
keypress and keydown events to enforce the rules you want. For example,
let's
say we have a textbox called txtZipCode where we want to enforce that only
numeric
characters may be entered. You can do this:

_private bool _nonNumberEntered;

private void txtZipCode_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
if (_nonNumberEntered == true)
e.Handled = true;
}

private void txtZipCode_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
_nonNumberEntered = false;

if (e.KeyCode < Keys.D0 || e.KeyCode > Keys.D9)
if (e.KeyCode < Keys.NumPad0 || e.KeyCode > Keys.NumPad9)
if(e.KeyCode != Keys.Back)
_nonNumberEntered = true;
}

--
Darren Shaffer
Principal Architect
Connected Innovation

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Chris,
> I was looking for a masked editbox on the web when I chance upon your
> entry. Would it be possible for you to email me your control too?
> Thanks in advance.
>
> Dylan.
>
> chris-s wrote:
>> I've got one I can email you if you wish.
>>
>> Chris.
>>
>>
>> "n2alexan" <(E-Mail Removed)> wrote in message
>> news:4d7d01c325f6$e6123000$(E-Mail Removed)...
>> > Hi,
>> > I am looking for a mask Edit control to validate user
>> > entry.
>> > I want the user to be able to enter number with specified
>> > decimal places after the point.
>> > I have managed to use Regular Expression and Text Box to
>> > validate the entry. However, Mask Edit Control would be an
>> > ideal solution. Does this control exits in CF? Or could
>> > anyone give an advise where I can find customised text box
>> > control.
>> > thank you
>> > Nataliya

>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
edit mask MM/YYYY mcnewsxp Microsoft Access Form Coding 7 30th Jun 2006 03:54 PM
What edit mask to use.... Brad Pears Microsoft Access Form Coding 6 27th Oct 2005 09:28 PM
Edit Mask =?Utf-8?B?U3ByaW5nd2Fsa2Vy?= Microsoft Excel Misc 2 24th Aug 2005 12:06 AM
Mask Edit control In ASP.NET for phone # or Zip CAradhana@gmail.com Microsoft ASP .NET 7 12th Apr 2005 10:37 PM
Cross-Browser Mask Edit Control =?Utf-8?B?VGFp?= Microsoft ASP .NET 2 30th Dec 2004 07:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:26 AM.