Jump to content

Mouse hover button - transparent


autoking
 Share

Recommended Posts

take a look at

Here is a example

#include "GUICtrlOnHover.au3"

GUICreate("PlayHD Example")
GUISetBkColor(0x00FF00)
GUISetState()

Global $Label[3]

$Label[0] = GUICtrlCreateLabel("Label1",8,20)
$Label[1] = GUICtrlCreateLabel("Label2",8,60)
$Label[2] = GUICtrlCreateLabel("Label4",8,120,-1,-1,0x1000) ;;$SS_SUNKEN

_GUICtrl_OnHoverRegister($Label[0],"onHover","onNormal")
_GUICtrl_OnHoverRegister($Label[1],"onHover","onNormal")
_GUICtrl_OnHoverRegister($Label[2],"onHover","onNormal")

GUICtrlSetBkColor($Label[0],0xFF0000)
GUICtrlSetBkColor($Label[1],0x0000FF)
GUICtrlSetBkColor($Label[2],-2)
While 1
$gMsg = GUIGetMsg()
Switch $gMsg
Case -3 ; X button
Exit
EndSwitch
WEnd

Func onHover($idCtrl)
Switch $idCtrl
Case $Label[0]
GUICtrlSetBkColor($Label[0],-2)
Case $Label[1]
GUICtrlSetData($Label[1],"Hover")
Case $Label[2]
GUICtrlSetColor($Label[2],0xFF0000)
EndSwitch
EndFunc

Func onNormal($idCtrl)
Switch $idCtrl
Case $Label[0]
GUICtrlSetBkColor($Label[0],0xFF0000)
Case $Label[1]
GUICtrlSetData($Label[1],"Label1")
Case $Label[2]
GUICtrlSetColor($Label[2],-2)
EndSwitch
EndFunc
Edited by PlayHD
Link to comment
Share on other sites

@autoking: what do you mean with "make it transparent" exactly?

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Soemthing like that here?

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
$hGUI = GUICreate("Test", 300, 200)

$hGUI_Child = GUICreate("", 100, 75, 100, 50, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$idButton = GUICtrlCreateButton("Test", 0, 0,100, 50)
GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hGUI_Child)
Global $bUpdateOn = True, $bUpdateOFF = True

Do
    $aCtrl = GUIGetCursorInfo($hGUI_Child)
    Switch $aCtrl[4]
    Case $idButton
            If $bUpdateOFF Then
                WinSetTrans($hGUI_Child, "", 0x60)
                $bUpdateOFF = False
                $bUpdateOn = True
            EndIf
        Case Else
            If $bUpdateOn Then
                WinSetTrans($hGUI_Child, "", 0xFF)
                $bUpdateOn = False
                $bUpdateOFF = True
            EndIf
    EndSwitch
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $idButton
            MsgBox(0, "Test", "Button was pressed")
        EndSwitch
Until False

GUIDelete($hGUI_Child)
GUIDelete($hGUI)
Exit

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...