MariusN Posted January 8, 2010 Share Posted January 8, 2010 I have tried this but it doesnt work...any ideas on this? $but1 = "1" GUICtrlSetFont(-1, 9, 700, 0, $font) GUICtrlSetColor(-1, 0x3333FF) $BUTTON_1 = GUICtrlCreateButton($but1 &"Help Me", 30, 150, 110, 20) The "1" is suppose to be blue and must show on/in the "Button" of 'Help Me' Link to comment Share on other sites More sharing options...
Hawkwing Posted January 8, 2010 Share Posted January 8, 2010 the GUICtrlSetFont and GUICtrlSetColor won't work because $but1 isn't a control. I don't think it's possible to have multiple text colors/fonts on a button. The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
MariusN Posted January 8, 2010 Author Share Posted January 8, 2010 the GUICtrlSetFont and GUICtrlSetColor won't work because $but1 isn't a control. I don't think it's possible to have multiple text colors/fonts on a button.Yep, that's exactly what i want to do...changing the text of a button's font Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 8, 2010 Moderators Share Posted January 8, 2010 MariusN,You were very nearly right, but you need to use the GUICtrlSetFont/Color commands AFTER creating the control. The "-1" is shorthand for "last control created":#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $hButton_1 = GUICtrlCreateButton("Normal", 10, 10, 80, 30) $hButton_2 = GUICtrlCreateButton("Big", 10, 100, 80, 40) GUICtrlSetFont(-1, 18) GUICtrlSetColor(-1, 0xFF0000) $hButton_3 = GUICtrlCreateButton("Small", 10, 200, 80, 30) GUICtrlSetFont(-1, 6) GUICtrlSetColor(-1, 0x0000FF) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MariusN Posted January 8, 2010 Author Share Posted January 8, 2010 (edited) MariusN, You were very nearly right, but you need to use the GUICtrlSetFont/Color commands AFTER creating the control. The "-1" is shorthand for "last control created": #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $hButton_1 = GUICtrlCreateButton("Normal", 10, 10, 80, 30) $hButton_2 = GUICtrlCreateButton("Big", 10, 100, 80, 40) GUICtrlSetFont(-1, 18) GUICtrlSetColor(-1, 0xFF0000) $hButton_3 = GUICtrlCreateButton("Small", 10, 200, 80, 30) GUICtrlSetFont(-1, 6) GUICtrlSetColor(-1, 0x0000FF) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M23 Thanks M23...noe i feel a bit better Edited January 8, 2010 by MariusN Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 8, 2010 Moderators Share Posted January 8, 2010 MariusN,When you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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