dabus Posted October 27, 2005 Share Posted October 27, 2005 Hi @ all, I'm just trying to set some diffrent fonts for diffrent states. So I read that GuiSetCrtlFont GuiSetFont, and thought "" as fontname should set things to the default font. As far as I can see, this does not work. I use 3.1.1, example is here: #include <GuiConstants.au3> GUICreate ( "Bla" ) GUICtrlCreateLabel ( "Test" ,10,10) $Test=GUICtrlCreateLabel ( "Test",10,30) GUISetState () GUICtrlSetFont ( $Test,9, 400, 0, ""); All the default I could find in the help-file. GUICtrlSetColor ( $Test, 0xff0000) While 1 $Antwort = GUIGetMsg() Select Case $Antwort = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd It's not that critical, but would be nice to know. Link to comment Share on other sites More sharing options...
Valuater Posted October 27, 2005 Share Posted October 27, 2005 this was the best i could do #include <GuiConstants.au3> GUICreate ( "Bla" ) GUISetFont( 10, 400) GUICtrlCreateLabel ( "Test" ,10,10) $Test=GUICtrlCreateLabel ( "Test",10,30, 80, 25) $btn1 = GUICtrlCreateButton("change", 20, 150, 80, 20) $btn2 = GUICtrlCreateButton("reset", 120, 150, 80, 20) GUISetState () While 1 $Antwort = GUIGetMsg() Select Case $Antwort = $btn1 GUICtrlSetFont ( $Test,16, 700, 0, ""); All the default I could find in the help-file. GUICtrlSetColor ( $Test, 0xff0000) Case $Antwort = $btn2 GUICtrlSetFont ( $Test, -1, -1, -1, -1) GUICtrlSetColor ( $Test, -1) Case $Antwort = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd 8) Link to comment Share on other sites More sharing options...
dabus Posted October 27, 2005 Author Share Posted October 27, 2005 So you do GuiSetFont & -1 ... That's ok. Thx Link to comment Share on other sites More sharing options...
Valuater Posted October 27, 2005 Share Posted October 27, 2005 So you do GuiSetFont & -1 ... That's ok. Thx i did notice that i had to useGUISetFont( 10, 400)otherwise the -1 would only reset to 10 point font.... not the original 9 point fontthis may be an error in Autoit8) Link to comment Share on other sites More sharing options...
dabus Posted October 27, 2005 Author Share Posted October 27, 2005 Yes, I got that error, too. Switched to GUISetFont( 9.005, 400, 0, "Arial") What's the default-font, anyway? Link to comment Share on other sites More sharing options...
Valuater Posted October 27, 2005 Share Posted October 27, 2005 Yes, I got that error, too.Switched to GUISetFont( 9.005, 400, 0, "Arial")What's the default-font, anyway?thats what i was sayingthe original "default" font appears to be 9 pointhowever when i tried to "reset" the font it would only go down to 10 point not 9 point..thus, i had to make the default 10 point in the script so it would work correctly..if you useGUISetFont( 9.005, 400, 0, "Arial")then my test script will not work... ( because it will only reduce the test line to 10 point )it seems as Autoit starts in 9 point font and when asked to return to default it goes to 10 point font8) Link to comment Share on other sites More sharing options...
dabus Posted October 28, 2005 Author Share Posted October 28, 2005 Sure, I don't use -1 but put GUICtrlSetFont( 9.005, 400, 0, "Arial") to go the super-secure way... Link to comment Share on other sites More sharing options...
peter1234 Posted October 28, 2005 Share Posted October 28, 2005 This works for me: GUISetFont (8, 400, 0, "MS Sans Serif") Link to comment Share on other sites More sharing options...
dabus Posted October 28, 2005 Author Share Posted October 28, 2005 That's it. Thx a lot. Problem solved. Link to comment Share on other sites More sharing options...
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