|
-
February 4th, 2008, 03:17 PM
#1
Font -
Sup guys,
How would I forcefully set a font size in my program and not allow to change(so default font has no effect)?
Thanks.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 4th, 2008, 05:01 PM
#2
Re: Font -
Use LOGFONT with CreateFontIndirect.
That should do it.
It allows you to specify font size and it shouldn't change.
-
February 4th, 2008, 05:11 PM
#3
Re: Font -
Thanks for that! Now, how would achieve the same result when you are creating a dialog? I mean, how do set a font so that the default font isn't used?
Edit - Are there programs to create fonts? And if there are then could you use them using the function you mensioned?
Thanks.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 4th, 2008, 05:16 PM
#4
Re: Font -
You use the HFONT returned by CreateFont or CreateFontIndirect and supply it in a call to SelectObject. The other parameter of SelectObject HDC should be the Device Context of the dialog (as returned by GetDC).
-
February 4th, 2008, 05:37 PM
#5
Re: Font -
No I meant, how can I set the default font through the template? I'm pretty sure this is how people do it.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 4th, 2008, 05:42 PM
#6
Re: Font -
 Originally Posted by .pcbrainbuster
No I meant, how can I set the default font through the template?
You should be more specific in your question, the next time around.
You would right-click the dialog in Visual Studio editor and change the 'Font' property.
Obvious, isn't it? 
 Originally Posted by .pcbrainbuster
I'm pretty sure this is how people do it.
Are you really so sure? What if the programmer needs to set a font that is not available on his programming environment?
-
February 4th, 2008, 05:50 PM
#7
-
February 5th, 2008, 04:47 AM
#8
Re: Font -
You can change form font in Object Inspector.
There is property combobox: "+Font (TFont)" Click on three dots button "..."
There you can set the font you like.
I suggest you to download free ebook and learn more about C++ builder, before asking questions here. Seems that you dont want to or dont know how to use Google.
First result (PDF)
http://www.google.ee/search?hl=et&q=...&btnG=Otsi&lr=
Download and learn.
Rate my post if i it was useful!
-
February 5th, 2008, 02:31 PM
#9
Re: Font -
That only works if you're working with forms...
Any ideas?
Thanks.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 21st, 2008, 02:58 PM
#10
Re: Font -
You can use the same fonts for Dialogs.
A dialog is just a kind of Window anyway.
You can still use CreateFontIndirect, but you may have to go the way of custom dialogs - I'm not sure because I don't work much with Dialogs.
-
February 22nd, 2008, 03:53 AM
#11
Re: Font -
I mean, how do set a font so that the default font isn't used?
WM_SETFONT
No I meant, how can I set the default font through the template? I'm pretty sure this is how people do it.
Code:
IDD_MYDLG DIALOG 0, 0, 180, 120
STYLE WS_POPUP | WS_CAPTION | DS_SETFONT
CAPTION "Dialog"
FONT 8, "MS Shell Dlg"
BEGIN
END
Last edited by Igor Vartanov; February 22nd, 2008 at 03:58 AM.
Best regards,
Igor
-
February 22nd, 2008, 09:06 PM
#12
Re: Font -
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 23rd, 2008, 12:53 AM
#13
Re: Font -
 Originally Posted by .pcbrainbuster
lol  I would if I could; I don't use Visual C++ instead its Borland C++ Builder 6  Have you maybe got a link that may help me?
Thank you! 
Your welcome. Here you go. http://msdn2.microsoft.com/en-us/vst.../aa700831.aspx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|