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.
Printable View
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.
Use LOGFONT with CreateFontIndirect.
That should do it.
It allows you to specify font size and it shouldn't change.
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. :)
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).
No I meant, how can I set the default font through the template? I'm pretty sure this is how people do it.
You should be more specific in your question, the next time around.Quote:
Originally Posted by .pcbrainbuster
You would right-click the dialog in Visual Studio editor and change the 'Font' property.
Obvious, isn't it? ;)
Are you really so sure? ;) What if the programmer needs to set a font that is not available on his programming environment?Quote:
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! ;)
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.
That only works if you're working with forms...
Any ideas?
Thanks.
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.
WM_SETFONTQuote:
I mean, how do set a font so that the default font isn't used?
Quote:
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
Thanks! RESOLVED
Your welcome. Here you go. http://msdn2.microsoft.com/en-us/vst.../aa700831.aspxQuote:
Originally Posted by .pcbrainbuster