Sign in to follow this  
Followers 0
timsta97

Invisable Buttons

12 posts in this topic

#1 ·  Posted (edited)

How can I make a button invisible but still clickable? I had tried to use GUISetState( $hButton, 32 ), but that hides the button and dosn't make it usable. Any thoughts?

Edited by timsta97

Share this post


Link to post
Share on other sites



How can I make a button invisible but still clickable? I had tried to use GUISetState( $hButton, 32 ), but that hides the button and dosn't make it usable. Any thoughts?

Move the button outside the window client area. For example, to the point with coordinates (-100; -100).

Share this post


Link to post
Share on other sites

Use an empty label.

#include <GUIConstantsEx.au3>

GUICreate("Test", 640, 320)
$InvisibleButton = GUICtrlCreateLabel("", 320, 0, 320, 480)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $InvisibleButton
            MsgBox(0, "You pressed on:", $InvisibleButton)
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

Use an empty label.

#include <GUIConstantsEx.au3>

GUICreate("Test", 640, 320)
$InvisibleButton = GUICtrlCreateLabel("", 320, 0, 320, 480)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $InvisibleButton
            MsgBox(0, "You pressed on:", $InvisibleButton)
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

If I use a label with no text, won't it show a grey box if I put a picture in the background?

Share this post


Link to post
Share on other sites

This should work for you. Just hide the lines

http://www.autoitscript.com/forum/index.php?showtopic=89034&st=0&p=639786&#entry639786

Share this post


Link to post
Share on other sites

I don't know, is there possibly an easier way?

Share this post


Link to post
Share on other sites

timsta97,

By chance I have just posted a very simple example of how to use Malkey's "invisible button" here. It is easy to do - just take a look and ask if anything is unclear. >_<

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

To me it seems like your talking to me like a child, Melba23. I only asked because I needed a faster way to do it. The UDFs that were offered were great, but time consuming to use. Thanks for all your help, but I don't need to do that task that badly.

Share this post


Link to post
Share on other sites

timsta97,

When picea892 showed you malkey's UDF, you asked:

is there possibly an easier way

I had a ready made script showing how easy Malkey's idea could be to implemented in a script - I thought you might be interested, so I offered it as an example. If you believe that doing so was

talking to me like a child

then I assure you it was not - it was a genuine offer of help.

I do enough talking to children (and those who act like them >_<) to do more than I must!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

if your putting a picture behind it. just have GUIGetMsg($picture) no button, or label, or if not

add this under the label: GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT).

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Share this post


Link to post
Share on other sites

if your putting a picture behind it. just have GUIGetMsg($picture) no button, or label, or if not

add this under the label: GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT).

I have a hunch he's trying to do image mapping by setting a background image. Then if you click on an area in the image, it will perform a function. Personaly I think that he would be better off to embed an html page and use standard image mapping to get what he wants.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

if your putting a picture behind it. just have GUIGetMsg($picture) no button, or label, or if not

add this under the label: GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT).

yeah....that was easy. Thanks for this example.

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