Link to home
Start Free TrialLog in
Avatar of greenbird
greenbird

asked on

urgent help! how to change font ?

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!
Avatar of akalmani
akalmani

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.
ASKER CERTIFIED SOLUTION
Avatar of V_Bapat
V_Bapat
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of greenbird

ASKER

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!
Why do you need that?
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?
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!
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!
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
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!
You can mail me the code. My email id is vicky@miel.mot.com.
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...