[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

urgent help! how to change font ?

Posted on 2000-03-06
11
Medium Priority
?
206 Views
Last Modified: 2013-12-03
Hi,

i write some words on a button, now i wantt o change their font... how to do that? since i am new to VC++ and now not much time left for my project, could u pls provide some detailed help? thanks a  lot!
0
Comment
Question by:greenbird
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
11 Comments
 
LVL 3

Expert Comment

by:akalmani
ID: 2590034
Hi GreenBird !!
 IF u are having owner draw button  then set the font in the OnDrawItem() for the device context.
If u are not having owner draw buttons then get the pointer to CButton by
CButton *pButton = (CButton *)GetDlgItem(IDC_BUTTON);
CFont Font();//create the font object according to u r need using create
pButton->SetFont(Font,TRUE);
The third method is to have u r button class derived from CButton and set the font in OnCreate() of it.
0
 
LVL 3

Accepted Solution

by:
V_Bapat earned 40 total points
ID: 2590437
In DrawItem() do this:

CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
CFont myFont;
myFont.CreateFont(20, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Impact");
dc.SelectObject(&myFont);

This will display text in 'Impact' font. You can change parameters in CreateFont() to suit your needs.

All the best.

Vicky
0
 

Author Comment

by:greenbird
ID: 2590489
Hi,

thanks... but just now i found that it is a static control, not a button... sorry.... Vicky, in ur code, where is the id or name of the button/static text control?

thanks a lot!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:V_Bapat
ID: 2590502
Why do you need that?
0
 

Author Comment

by:greenbird
ID: 2590512
Hi,

actually i have a program , on the main window i will display the title of my program " Diabetic Eye Disease Analysis System". i dunno how to make it nice, i just use a static text control to display it (with backgrounds).... and i need to make the font  bigger.... that is why i use it...

sigh that my interface is quite "ugly" :)

so how to do it?
0
 

Author Comment

by:greenbird
ID: 2590515
Hi,

actually i have a program , on the main window i will display the title of my program " Diabetic Eye Disease Analysis System". i dunno how to make it nice, i just use a static text control to display it (with backgrounds).... and i need to make the font  bigger.... that is why i use it...

sigh that my interface is quite "ugly" :)

so how to do it?

Vicky, sorry for another request, if u have time, are u able to make a nice title (maybe displayed in static text control or button or whatever....only for display purpose) for me? if u are busy, ignore it, it is ok... thanks a lot!
0
 

Author Comment

by:greenbird
ID: 2590522
hi, Vicky

my project presentation is on this coming thursday. i had gained much much help from EE. without ur help, i can not finish my project... really appreciate the great help u had given...
(however i hered that my evaluators are famous killers, hope they will not put me in a hard position. god bless me.)

have a nice day!
0
 
LVL 3

Expert Comment

by:V_Bapat
ID: 2590578
What do you mean by "on the main window i will display the title of my program"? Do you mean you have to show the title only once or it should be displayed in the background?

Since you don't have much time, You would have to explain the things in detail. Put as much info as possible for me to understand the things properly.

All the best.

Vicky
0
 

Author Comment

by:greenbird
ID: 2590609
Hi, Vicky,

i have anotehr qn now:

ok. have u ever used the JPeg.cpp ? ( i think in MSDN? anyway i got it from otehrs). i use it to load an iamge file as background... however the problem is that the image is not displayed properly(such as if u use an image for ur web background, it is displayed as what it is like, but in my program, the pixel is stretched... therefore the screen is not nice..)
do u know how to solve it? i can post the code later...

the above is not relevant to the previous qn yet :) i can change the font now, so ignore the fone qn now.

so vicky now my problem is that could u pls help me find the problem when loading the background image? i f u need the code, i can email it to u.

thanks a lot!
0
 
LVL 3

Expert Comment

by:V_Bapat
ID: 2592052
You can mail me the code. My email id is vicky@miel.mot.com.
0
 

Author Comment

by:greenbird
ID: 2594024
Hi, Vicky,

i do not have time now. i just let it be bah... have to pratice for presentation now... anyway thanks a lot! really thanks for ur great help!

bye...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question