AutoItGal Posted August 8, 2007 Share Posted August 8, 2007 I am wondering whether is it possible for me to place an icon picture and it's name beside it. Something like the one in the following forum.http://www.autoitscript.com/forum/index.php?showtopic=20967But I want to do it on a button.Thanks. Link to comment Share on other sites More sharing options...
Valuater Posted August 8, 2007 Share Posted August 8, 2007 Autoit Wrappers... is your firendsee Icon on Button with Text (made easy)8) Link to comment Share on other sites More sharing options...
AutoItGal Posted August 8, 2007 Author Share Posted August 8, 2007 Hi , Your code works. But I have a problem. When I create a tab using "GUICTRLCREATETAB", the tab window covers the button and the text. How to make it visible? Link to comment Share on other sites More sharing options...
AutoItGal Posted August 10, 2007 Author Share Posted August 10, 2007 Anyone can help me out with this? Link to comment Share on other sites More sharing options...
ResNullius Posted August 10, 2007 Share Posted August 10, 2007 Anyone can help me out with this? Can you post the code you're having problems with... Link to comment Share on other sites More sharing options...
AutoItGal Posted August 14, 2007 Author Share Posted August 14, 2007 Can you post the code you're having problems with... Here is the code by Valuater added a tab window. When I add the tab window, the button will be blocked by the tab window. Please help me. Thanks. ; Icon on Button - (made easy) ; Author - Valuater #include <GUIConstants.au3> $mywin = GUICreate("my gui") $tab=GUICtrlCreateTab(30,30,500,455); Added a tab window here. This will cover the button up. $btn1 = IconButton("Help", 30, 30, 70, 32, 23) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $btn1 Then MsgBox(0,0,"You pressed the Icon Button ", 2) If $msg = $GUI_EVENT_CLOSE Then Exit WEnd Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll") GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16) GUICtrlSetState( -1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc Link to comment Share on other sites More sharing options...
ResNullius Posted August 14, 2007 Share Posted August 14, 2007 Here is the code by Valuater added a tab window. When I add the tab window, the button will be blocked by the tab window. Please help me.Thanks.Do you want the button on the tab? Or above the tab? Link to comment Share on other sites More sharing options...
AutoItGal Posted August 14, 2007 Author Share Posted August 14, 2007 Do you want the button on the tab? Or above the tab?Above the tab Link to comment Share on other sites More sharing options...
ResNullius Posted August 14, 2007 Share Posted August 14, 2007 Above the tabThen you need to change the co-ordinates of your tab and/or button; both right now are at 30, 30 so naturally they are occupying the same space.Try changing these two lines as follows:$tab=GUICtrlCreateTab(30,50,500,455); Added a tab window here. This will cover the button up.$btn1 = IconButton("Help", 30, 10, 70, 32, 23) Link to comment Share on other sites More sharing options...
AutoItGal Posted August 20, 2007 Author Share Posted August 20, 2007 Then you need to change the co-ordinates of your tab and/or button; both right now are at 30, 30 so naturally they are occupying the same space.Try changing these two lines as follows:$tab=GUICtrlCreateTab(30,50,500,455); Added a tab window here. This will cover the button up.$btn1 = IconButton("Help", 30, 10, 70, 32, 23)This does not solve my problem. I want the button on top of the tab window. I have several tab windows, and I want to put some buttons on top of each of the tab windows. Link to comment Share on other sites More sharing options...
Zedna Posted August 20, 2007 Share Posted August 20, 2007 ; Icon on Button - (made easy) ; Author - Valuater #include <GUIConstants.au3> $mywin = GUICreate("my gui",600,500) $tab=GUICtrlCreateTab(30,30,500,455); Added a tab window here. This will cover the button up. $tab1=GUICtrlCreateTabitem ("tab1") $btn1 = IconButton("Help1", 30, 50, 70, 32, 23) $tab2=GUICtrlCreateTabitem ("tab2") $btn2 = IconButton("Help2", 30, 100, 70, 32, 23) GUICtrlCreateTabitem (""); end tabitem definition GUISetState() While 1 $msg = GUIGetMsg() If $msg = $btn1 Then MsgBox(0,0,"You pressed the Icon Button ", 2) If $msg = $GUI_EVENT_CLOSE Then Exit WEnd Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll") GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16) GUICtrlSetState( -1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
AutoItGal Posted August 20, 2007 Author Share Posted August 20, 2007 ; Icon on Button - (made easy) ; Author - Valuater #include <GUIConstants.au3> $mywin = GUICreate("my gui",600,500) $tab=GUICtrlCreateTab(30,30,500,455); Added a tab window here. This will cover the button up. $tab1=GUICtrlCreateTabitem ("tab1") $btn1 = IconButton("Help1", 30, 50, 70, 32, 23) $tab2=GUICtrlCreateTabitem ("tab2") $btn2 = IconButton("Help2", 30, 100, 70, 32, 23) GUICtrlCreateTabitem (""); end tabitem definition GUISetState() While 1 $msg = GUIGetMsg() If $msg = $btn1 Then MsgBox(0,0,"You pressed the Icon Button ", 2) If $msg = $GUI_EVENT_CLOSE Then Exit WEnd Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll") GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16) GUICtrlSetState( -1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc The button is still hidden.... Link to comment Share on other sites More sharing options...
Zedna Posted August 20, 2007 Share Posted August 20, 2007 The button is still hidden....I solved only your Tab issue.There is some problem with proposed IconButton() function. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted August 20, 2007 Share Posted August 20, 2007 Try this and you will see there is some problem in IconButton() #include <GUIConstants.au3> $mywin = GUICreate("my gui",600,500) $tab=GUICtrlCreateTab(30,30,500,455); Added a tab window here. This will cover the button up. $tab1=GUICtrlCreateTabitem ("tab1") $btn1 = GUICtrlCreateButton("Help1", 30, 60, 70, 32) ;~ $btn1 = IconButton("Help1", 30, 60, 70, 32, 23) $tab2=GUICtrlCreateTabitem ("tab2") $btn2 = GUICtrlCreateButton("Help2", 30, 100, 70, 32) ;~ $btn2 = IconButton("Help2", 30, 100, 70, 32, 23) GUICtrlCreateTabitem (""); end tabitem definition GUISetState() While 1 $msg = GUIGetMsg() If $msg = $btn1 Then MsgBox(0,0,"You pressed the Icon Button ", 2) If $msg = $GUI_EVENT_CLOSE Then Exit WEnd Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll") GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16) GUICtrlSetState( -1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted August 20, 2007 Share Posted August 20, 2007 Without Tabs it's working OK:#include <GUIConstants.au3> $mywin = GUICreate("my gui",600,500) $btn1 = IconButton("Help1", 30, 60, 70, 32, 23) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $btn1 Then MsgBox(0,0,"You pressed the Icon Button ", 2) If $msg = $GUI_EVENT_CLOSE Then Exit WEnd Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll") GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16) GUICtrlSetState( -1, $GUI_DISABLE) $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFuncI don't know how to fix this.Maybe use STM_SETIMAGE message, see my post Resources UDF ResourcesEx UDF AutoIt Forum Search 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