CEdit box ** CEdit box ** CEdit box 
Author Message
 CEdit box ** CEdit box ** CEdit box

First of all, MERRY CHRISTMAS!

Now, can anyone tell me how to put characters in edit boxes that CANNOT be
erased or overridden by the user????  For example, in a phone number box,
I need to permanently display parenthesis and a dash:  (     )       -

       (714) 888-8888
 Somene suggested a "masked" edit box, but I have not found any info on these
anywhere.  Please Help!

Thanks

martin



Mon, 12 Jun 2000 03:00:00 GMT  
 CEdit box ** CEdit box ** CEdit box

There are masked textboxes out there, you just have to find them.
Go to www.activex.com and search for "DataMask"  This is a shareware
control that allows masked data - ideal for phone numbers, addresses,
and e-mail addresses.  Since it's shareware, you may want to search
around for a freeware one - you just have to look around...

Quote:

> First of all, MERRY CHRISTMAS!

> Now, can anyone tell me how to put characters in edit boxes that CANNOT be
> erased or overridden by the user????  For example, in a phone number box,
> I need to permanently display parenthesis and a dash:  (     )       -

>        (714) 888-8888
>  Somene suggested a "masked" edit box, but I have not found any info on these
> anywhere.  Please Help!

> Thanks

> martin

--

*********************************************
**       From the Mind of Shaheen          **

**    ------------------------------       **
** You can never take life too seriously.  **
**    You'll never get out of it alive.    **
*********************************************



Tue, 13 Jun 2000 03:00:00 GMT  
 CEdit box ** CEdit box ** CEdit box

This is what I would do.

Create a CEdit subclass called CMyEdit class.
Inside the subclass, handle ON_WM_CHAR message
as follows.

void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
        // Don't invoke the default handler
        // CEdit::OnChar(nChar, nRepCnt, nFlags);

Quote:
}

The code above rejects any user key input.
To set a text in CEdit Box, simply use
        SetWindowText("(714) 888-8888").

Mark T.

Quote:
> > Now, can anyone tell me how to put characters in edit boxes that CANNOT
be
> > erased or overridden by the user????  For example, in a phone number
box,
> > I need to permanently display parenthesis and a dash:  (     )       -

> >        (714) 888-8888
> > martin



Sun, 25 Jun 2000 03:00:00 GMT  
 CEdit box ** CEdit box ** CEdit box

Make it "Read-Only"

Quote:

>This is what I would do.

>Create a CEdit subclass called CMyEdit class.
>Inside the subclass, handle ON_WM_CHAR message
>as follows.

>void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
>{
> // Don't invoke the default handler
> // CEdit::OnChar(nChar, nRepCnt, nFlags);
>}
>The code above rejects any user key input.
>To set a text in CEdit Box, simply use
> SetWindowText("(714) 888-8888").

>Mark T.

>> > Now, can anyone tell me how to put characters in edit boxes that CANNOT
>be
>> > erased or overridden by the user????  For example, in a phone number
>box,
>> > I need to permanently display parenthesis and a dash:  (     )       -

>> >        (714) 888-8888
>> > martin



Sun, 25 Jun 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. backspace and CEdit box (ATL) Problem

2. For Ed: Newbie Question about populating a CEdit box

3. Newbie Question about populating a CEdit box

4. Mapping WM_messages to CEdit box

5. CEdit boxes

6. About Cedit text boxes.

7. Changing text color in a CEdit box

8. Question about display in CEdit box

9. Question about setting the font type in CEdit box

10. Modal dialog boxes and CEdits

11. Deselecting text in a CEdit box

12. CEdit box problem

 

 
Powered by phpBB® Forum Software