jimg Posted July 25, 2008 Posted July 25, 2008 I'd like to add some "bold" characters to my GUI.$font = "Tahoma Bold"_GDIPlus_GraphicsDrawString($hGraphic,$val, $x, $y,$font,10)draws nothing visible. Just "Tahoma" works fine (and the fonts are installed).I also tried the weight parameter in GUICtrlSetFont, but nothing from 0 to 40000 has any effect on the result.
BrettF Posted July 25, 2008 Posted July 25, 2008 (edited) ;Include Files #include <GuiConstantsEx.au3> #include <GuiEdit.au3> ;Declare Variables $iState = 0 ;Start GUI Code $GUI = GUICreate ("Test Window", 400, 300) $LabelControl = GUICtrlCreateLabel ("This is some text... Click the button bellow to set it to bold.", 10, 10, 380, 30) $button = GUICtrlCreateButton ("Click Me!", 10, 40, 100) ;Show GUI GUISetState () ;Start While loop While 1 $nMsg = GUIGetMsg () Switch $nMsg Case -3; Same as $GUI_ON_EVENT_CLOSE Exit Case $button If $iState = 1 Then; Text is already bold, we need to return it to normal. GUICtrlSetFont ($LabelControl, 8.5, 400, 0, "Tahoma") GUICtrlSetData ($LabelControl, "This is some text... Click the button bellow to set it to bold.") $iState = 0 ElseIf $iState = 0 Then;Text is not bold, we need to do that. GUICtrlSetFont ($LabelControl, 8.5, 800, 0, "Tahoma") GUICtrlSetData ($LabelControl, "This is some text... Click the button bellow to set it to normal.") $iState = 1 Else; Something went wrong MsgBox (32, "ERROR", "SOMETHING IS VERY WRONG!") EndIf EndSwitch WEndEDIT: http://www.autoitscript.com/autoit3/docs/appendix/fonts.htmCheers,Brett Edited July 25, 2008 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
jimg Posted July 25, 2008 Author Posted July 25, 2008 ;Include Files #include <GuiConstantsEx.au3> #include <GuiEdit.au3> ;Declare Variables $iState = 0 ;Start GUI Code $GUI = GUICreate ("Test Window", 400, 300) $LabelControl = GUICtrlCreateLabel ("This is some text... Click the button bellow to set it to bold.", 10, 10, 380, 30) $button = GUICtrlCreateButton ("Click Me!", 10, 40, 100) ;Show GUI GUISetState () ;Start While loop While 1 $nMsg = GUIGetMsg () Switch $nMsg Case -3; Same as $GUI_ON_EVENT_CLOSE Exit Case $button If $iState = 1 Then; Text is already bold, we need to return it to normal. GUICtrlSetFont ($LabelControl, 8.5, 400, 0, "Tahoma") GUICtrlSetData ($LabelControl, "This is some text... Click the button bellow to set it to bold.") $iState = 0 ElseIf $iState = 0 Then;Text is not bold, we need to do that. GUICtrlSetFont ($LabelControl, 8.5, 800, 0, "Tahoma") GUICtrlSetData ($LabelControl, "This is some text... Click the button bellow to set it to normal.") $iState = 1 Else; Something went wrong MsgBox (32, "ERROR", "SOMETHING IS VERY WRONG!") EndIf EndSwitch WEnd EDIT: http://www.autoitscript.com/autoit3/docs/appendix/fonts.htm Cheers, Brett I guess I didn't do the original experiment correctly. Thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now