Sign in to follow this  
Followers 0
Xenobiologist

Button clicked and not clicked

4 posts in this topic

Hi,

I'm not really good in Autoit and even worse in making nice GUIs. So, can anybody tell we the best way to make buttons that are raised and after clicking / hitting them, the buttons show that they were pressed?!

I played a little bit with the styles, but I haven't found something that catches eye, so that everybody can easily see: Yes, that button was pressed.

Thanks!

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites



I would try

GUICtrlSetStyle ($button1, $BS_FLAT)

When you want it to be flat. Can't try if it is correct at the moment thought.

Share this post


Link to post
Share on other sites

I would try

GUICtrlSetStyle ($button1, $BS_FLAT)

When you want it to be flat. Can't try if it is correct at the moment thought.

HI,

this is my test script, but I still haven't found whar I'm looking for.

#include <GUIConstants.au3>
HotKeySet("1", "_1")
HotKeySet("2", "_2")
HotKeySet("3", "_3")
HotKeySet("4", "_4")
HotKeySet("5", "_5")


GUICreate("My GUI Button"); will create a dialog box that when displayed is centered

Opt("GUICoordMode", 2)
$Button_2 = GUICtrlCreateButton("Get foucs", 10, 30, 100, 20)
$Button_1 = GUICtrlCreateButton("Change style", 10, 130, 100, 20, $WS_BORDER, $WS_EX_WINDOWEDGE)

GUISetState()    ; will display an  dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
    EndSelect
WEnd

Func _1()
    GUICtrlSetStyle($Button_1, $BS_FLAT, $WS_EX_CLIENTEDGE)
    ConsoleWrite(1)
EndFunc  ;==>_1

Func _2()
    GUICtrlSetStyle($Button_1, $WS_BORDER, $WS_EX_WINDOWEDGE)
    ConsoleWrite(2)
EndFunc  ;==>_2

Func _3()
    GUICtrlSetStyle($Button_1, "", $WS_EX_STATICEDGE)
    ConsoleWrite(3)
EndFunc  ;==>_3

Func _4()
    GUICtrlSetStyle($Button_1, $BS_FLAT, $WS_EX_WINDOWEDGE)
    ConsoleWrite(4)
EndFunc  ;==>_4

Func _5()
    GUICtrlSetStyle($Button_1, $WS_BORDER, $WS_EX_WINDOWEDGE)
    ConsoleWrite(5)
EndFunc  ;==>_5

Any ideas?

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

HI again!

No one any idea? How to show a button was clicked? There must be a difference in the look&feel of the button after it was clicked.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0