momar33 Posted September 28, 2007 Posted September 28, 2007 How would i create buttons similar to the windows quicklaunch buttons? By this i mean that the button would appear to just be an icon until it is moused over at which point it would look like a button. Thanks
Valuater Posted September 28, 2007 Posted September 28, 2007 (edited) Close, but not an icon ... just playing #include <GUIConstants.au3> $GUI = GUICreate("My GUI") $b = GUICtrlCreateButton("File", 0, 0, 25, 25) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState() While 1 $m = GUIGetMsg() If $m = -3 then Exit $c = GUIGetCursorInfo($GUI) If $c[4] = $b Then GUICtrlSetState( $b, $GUI_ENABLE) While $c[4] = $b If GUIGetMsg() = $b Then Do_Function() $c = GUIGetCursorInfo($GUI) WEnd GUICtrlSetState( $b, $GUI_DISABLE) EndIf WEnd Func Do_Function() MsgBox(0x0, "tset", "OK..... ", 3) EndFunc 8) Edited September 28, 2007 by Valuater
momar33 Posted October 1, 2007 Author Posted October 1, 2007 That's not a bad start. Unfortunately when you try to use $BS_ICON with it, the button looks different and the enable disable acts differently. Also when the button is disabled it shows up as a different color. I'm guessing this will require the use of custom made buttons, does anyone know of any UDFs for custom buttons?
martin Posted October 1, 2007 Posted October 1, 2007 (edited) That's not a bad start. Unfortunately when you try to use $BS_ICON with it, the button looks different and the enable disable acts differently. Also when the button is disabled it shows up as a different color. I'm guessing this will require the use of custom made buttons, does anyone know of any UDFs for custom buttons? Just a small mod to Valuater's code is all you need. expandcollapse popup#include <GUIConstants.au3> $GUI = GUICreate("My GUI") $ic = GUICtrlCreateIcon("shell32.dll",22,4,4,32,32) GUICtrlSetState(-1, $GUI_DISABLE) $b = GUICtrlCreateButton("File", 0, 0, 40, 40,$BS_ICON) GUICtrlSetImage (-1, "shell32.dll",22) GUICtrlSetState(-1,$GUI_HIDE) ;GUICtrlSetState(-1, $GUI_DISABLE) GUISetState() While 1 $m = GUIGetMsg() If $m = -3 then Exit $c = GUIGetCursorInfo($GUI) If $c[4] = $ic Then GUICtrlSetState( $b, $GUI_SHOW) GUICtrlSetState( $ic, $GUI_HIDE) ;Sleep(100) $c = GUIGetCursorInfo($GUI) While $c[4] = $b If GUIGetMsg() = $b Then Do_Function() $c = GUIGetCursorInfo($GUI) WEnd GUICtrlSetState( $b, $GUI_HIDE) GUICtrlSetState( $ic, $GUI_SHOW) EndIf WEnd Func Do_Function() MsgBox(0x0, "tset", "OK..... ", 3) EndFunc EDIT:small improvement. Edited October 1, 2007 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Madza91 Posted October 15, 2007 Posted October 15, 2007 that is cool.... is possible to GuiCtrlCreatePic on button down? [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
Valuater Posted October 15, 2007 Posted October 15, 2007 that is cool.... is possible to GuiCtrlCreatePic on button down?I would create the pic first and hide it. The on button click just show the picGUICtrlSetState( $Control, $GUI_SHOW)8)
Madza91 Posted October 15, 2007 Posted October 15, 2007 But how? I am noob ) [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
Blue_Drache Posted October 15, 2007 Posted October 15, 2007 He showed you how. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
Madza91 Posted October 15, 2007 Posted October 15, 2007 #include <GUIConstants.au3> $GUI = GUICreate("My GUI") $ic = GUICtrlCreatePic("1.jpg",0,0,100,23) GUICtrlSetState(-1, $GUI_DISABLE) $b = GUICtrlCreatePic("2.jpg",0,0,100,23) GUICtrlSetState(-1,$GUI_HIDE) $2 = GUICtrlCreatePic("3.jpg",0,0,100,23) GUICtrlSetState(-1,$GUI_HIDE) GUISetState() While 1 $m = GUIGetMsg() If $m = -3 then Exit $c = GUIGetCursorInfo($GUI) If $c[4] = $ic Then GUICtrlSetState( $b, $GUI_SHOW) GUICtrlSetState( $ic, $GUI_HIDE) ;Sleep(100) $c = GUIGetCursorInfo($GUI) While $c[4] = $b If GUIGetMsg() = $b Then Do_Function() $c = GUIGetCursorInfo($GUI) WEnd GUICtrlSetState( $b, $GUI_HIDE) GUICtrlSetState( $ic, $GUI_SHOW) EndIf WEnd Func Do_Function() GUICtrlSetState( $2, $GUI_SHOW) MsgBox(0x0, "tset", "OK..... ", 3) EndFunc This is fine but I want to see msg when Let that button not when I press button, like in default button ! (sorry for bad english) [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
Valuater Posted October 15, 2007 Posted October 15, 2007 Like this???http://www.xpcleanmenu.hostrocket.com/Autoit/WOW-Menu.exe8)
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