Author |
Message |
FDB #1 / 17
|
 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 |
|
 |
David Lownde #2 / 17
|
 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 |
|
 |
MOLINA Jean-Mar #3 / 17
|
 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 |
|
 |
MOLINA Jean-Mar #4 / 17
|
 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 |
|
 |
#5 / 17
|
 Changing Fonts for a CEdit control?
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
Ajay Kalr #6 / 17
|
 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 |
|
 |
FDB #7 / 17
|
 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 |
|
 |
Ajay Kalr #8 / 17
|
 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 |
|
 |
#9 / 17
|
 Changing Fonts for a CEdit control?
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
FDB #10 / 17
|
 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 |
|
 |
#11 / 17
|
 Changing Fonts for a CEdit control?
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
FDB #12 / 17
|
 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 |
|
 |
#13 / 17
|
 Changing Fonts for a CEdit control?
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
David Lownde #14 / 17
|
 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 |
|
 |
#15 / 17
|
 Changing Fonts for a CEdit control?
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
|