Changing Fonts for a CEdit control? 
Author Message
 Changing Fonts for a CEdit control?

Hello,

How do you change the font and the font-size of a CEdit control?
When and where do you place the code?
What do you have to know about the installed windows fonts?
How does left and right align of the CEdit work. Can I change this during
runtime? What functions do I have to call?
(What I try to do now is that I right or left align with the .Format
function of CString)

Maybe a simple Q, but I can't find any exclusive information about this.

Many thanks,

Kimball



Fri, 06 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?

Quote:
>How do you change the font and the font-size of a CEdit control?

Kimball,

Have a look at Knowledge Base article Q85518 "Correct Use of the
SetFont() Function in MFC".

Quote:
>How does left and right align of the CEdit work. Can I change this during
>runtime? What functions do I have to call?

Try using ModifyStyle with the appropriate ES_LEFT & ES_RIGHT flags.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Fri, 06 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?
You can do that using the VC interface.
One of the solution is to modify the CEdit
object in the InitDialog function of your application.
( window, dialog box... )

Get a pointer to it ( CEdit * )
Get the DC from it ( GetDC )
Use the common GDI function on the DC
- DrawText...

So you can draw whatever you want in the CEdit
object. Same for all the MFC object.

    JM.

--
MOLINA "GOA" Jean-Marc
web : http://www.ifrance.com/goa


Quote:
> Hello,

> How do you change the font and the font-size of a CEdit control?
> When and where do you place the code?
> What do you have to know about the installed windows fonts?
> How does left and right align of the CEdit work. Can I change this during
> runtime? What functions do I have to call?
> (What I try to do now is that I right or left align with the .Format
> function of CString)

> Maybe a simple Q, but I can't find any exclusive information about this.

> Many thanks,

> Kimball



Fri, 06 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?
I am sorry about it but my answer was wrong.
I completely forgot that I was using my own
classes.
You can find very useful sample on www.codeguru.com

    JM.

--
MOLINA "GOA" Jean-Marc
web : http://www.ifrance.com/goa


Quote:
> Hello,

> How do you change the font and the font-size of a CEdit control?
> When and where do you place the code?
> What do you have to know about the installed windows fonts?
> How does left and right align of the CEdit work. Can I change this during
> runtime? What functions do I have to call?
> (What I try to do now is that I right or left align with the .Format
> function of CString)

> Maybe a simple Q, but I can't find any exclusive information about this.

> Many thanks,

> Kimball



Fri, 06 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?


Fri, 19 Jun 1992 00:00:00 GMT  
 Changing Fonts for a CEdit control?
Take a look at ES_READONLY style.

--
Ajay Kalra

Microsoft VC++/MFC MVP
MVP VC FAQ: http://www.mvps.org/vcfaq

Note: Please post all replies to newsgroup only.


Quote:
> Thanks, I'll have a look at that, but another quick question: How can I
set
> the control to READ ONLY.


> > >How do you change the font and the font-size of a CEdit control?

> > Kimball,

> > Have a look at Knowledge Base article Q85518 "Correct Use of the
> > SetFont() Function in MFC".

> > >How does left and right align of the CEdit work. Can I change this
during
> > >runtime? What functions do I have to call?

> > Try using ModifyStyle with the appropriate ES_LEFT & ES_RIGHT flags.

> > Dave
> > --
> > MVP VC++ FAQ: http://www.mvps.org/vcfaq
> > My address is altered to discourage junk mail.
> > Please post responses to the newsgroup thread,
> > there's no need for follow-up email copies.



Sat, 07 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?
Thanks, I'll have a look at that, but another quick question: How can I set
the control to READ ONLY.


Quote:
> >How do you change the font and the font-size of a CEdit control?

> Kimball,

> Have a look at Knowledge Base article Q85518 "Correct Use of the
> SetFont() Function in MFC".

> >How does left and right align of the CEdit work. Can I change this during
> >runtime? What functions do I have to call?

> Try using ModifyStyle with the appropriate ES_LEFT & ES_RIGHT flags.

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq
> My address is altered to discourage junk mail.
> Please post responses to the newsgroup thread,
> there's no need for follow-up email copies.



Sat, 07 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?
You could also use CEdit::SetReadOnly() to set it.

pEdit->SetReadOnly(TRUE);

--
Ajay Kalra

Microsoft VC++/MFC MVP
MVP VC FAQ: http://www.mvps.org/vcfaq

Note: Please post all replies to newsgroup only.


Quote:
> Thanks, I'll have a look at that, but another quick question: How can I
set
> the control to READ ONLY.


> > >How do you change the font and the font-size of a CEdit control?

> > Kimball,

> > Have a look at Knowledge Base article Q85518 "Correct Use of the
> > SetFont() Function in MFC".

> > >How does left and right align of the CEdit work. Can I change this
during
> > >runtime? What functions do I have to call?

> > Try using ModifyStyle with the appropriate ES_LEFT & ES_RIGHT flags.

> > Dave
> > --
> > MVP VC++ FAQ: http://www.mvps.org/vcfaq
> > My address is altered to discourage junk mail.
> > Please post responses to the newsgroup thread,
> > there's no need for follow-up email copies.



Sat, 07 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?


Fri, 19 Jun 1992 00:00:00 GMT  
 Changing Fonts for a CEdit control?
Thanks,

I've read the artical but could you perhaps tell me how I can find out what
Font type I can use?
Can I e.g. use the names I found in the font directory:  names like Arial,
Courier.
Or is there a list.
What happens if the font is not installed on another system? Default fonts?
(which one)



Quote:
> >How do you change the font and the font-size of a CEdit control?

> Kimball,

> Have a look at Knowledge Base article Q85518 "Correct Use of the
> SetFont() Function in MFC".

> >How does left and right align of the CEdit work. Can I change this during
> >runtime? What functions do I have to call?

> Try using ModifyStyle with the appropriate ES_LEFT & ES_RIGHT flags.

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq
> My address is altered to discourage junk mail.
> Please post responses to the newsgroup thread,
> there's no need for follow-up email copies.



Sat, 07 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?


Fri, 19 Jun 1992 00:00:00 GMT  
 Changing Fonts for a CEdit control?
Thanks, I overlooked this one.
 Kimball



Quote:
> You could also use CEdit::SetReadOnly() to set it.

> pEdit->SetReadOnly(TRUE);

> --
> Ajay Kalra

> Microsoft VC++/MFC MVP
> MVP VC FAQ: http://www.mvps.org/vcfaq

> Note: Please post all replies to newsgroup only.



> > Thanks, I'll have a look at that, but another quick question: How can I
> set
> > the control to READ ONLY.


> > > >How do you change the font and the font-size of a CEdit control?

> > > Kimball,

> > > Have a look at Knowledge Base article Q85518 "Correct Use of the
> > > SetFont() Function in MFC".

> > > >How does left and right align of the CEdit work. Can I change this
> during
> > > >runtime? What functions do I have to call?

> > > Try using ModifyStyle with the appropriate ES_LEFT & ES_RIGHT flags.

> > > Dave
> > > --
> > > MVP VC++ FAQ: http://www.mvps.org/vcfaq
> > > My address is altered to discourage junk mail.
> > > Please post responses to the newsgroup thread,
> > > there's no need for follow-up email copies.



Sat, 07 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?


Fri, 19 Jun 1992 00:00:00 GMT  
 Changing Fonts for a CEdit control?

Quote:
>I've read the artical but could you perhaps tell me how I can find out what
>Font type I can use?
>Can I e.g. use the names I found in the font directory:  names like Arial,
>Courier.

Yes

Quote:
>What happens if the font is not installed on another system?

Windows will substitute a different face which it thinks matches the
other parameters specified for the font.

Quote:
> Default fonts?

The basic core fonts are Arial, Times New Roman, and Courier New.
Different versions of Windows and products will install additional
ones.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Sat, 07 Dec 2002 03:00:00 GMT  
 Changing Fonts for a CEdit control?


Fri, 19 Jun 1992 00:00:00 GMT  
 
 [ 17 post ]  Go to page: [1] [2]

 Relevant Pages 

1. changing font on a CEdit control

2. Changing Font in a CEdit control

3. changing font size in CEdit control

4. Changing Font in CEdit control

5. Changing the font of a CEdit control (non dialog)

6. How can I change the font of a CEdit control

7. How to change the font size for a CEdit control

8. How to change font of run-time CEdit controls

9. CEdit control .. change Font selection

10. CEdit controls and changing the font color

11. Changing the font of a multiline CEdit Control

12. Changing font style in CEdit derived control.

 

 
Powered by phpBB® Forum Software