Jump to content

Transparency with slider, made that way... when i stop pushing the button - child turns off.


Madza91
 Share

Recommended Posts

I want to make slider like on Win XP for Volume.. and i maded that but with error, when move slider than is ok but when i stop pushing the slider dissapear GUI and child but i want to dissapear only child, where is the error ?

#include <GuiConstants.au3>
$initran = Iniread("transparent.ini","1","transparent","255")
$gui = GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Button_1 = GuiCtrlCreateButton("Transparent", 100, 170, 180, 50)

WinSetTrans($gui,"",$initran)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_1
        tran()
    Case Else
    ;;;
    EndSelect
WEnd
Exit

Func tran()
$mpos = MouseGetPos()
$child4 = GUICreate("Sliding Toolbar", 75, 130, $mpos[0] - 81, $mpos[1] - 136, $WS_POPUP, $WS_EX_DLGMODALFRAME,$gui)
$trans = GUICtrlCreateLabel("Transparent",0,7,75,15,$SS_CENTER)
$Slider = GuiCtrlCreateSlider(25, 24, 26, 81,Bitor($TBS_VERT,$TBS_BOTH,$TBS_NOTICKS))
$button = GUICtrlCreateButton("Iskljuci",5,110,60,20)
GUICtrlSetLimit($Slider, 255, 1)
GUICtrlSetData($Slider, $initran)
GUISetState()

$old1 = GUICtrlRead($Slider)
While 1
    If GUICtrlRead($Slider) <> $old1 Then
        WinSetTrans($gui, "", GUICtrlRead($Slider))
        $old1 = GUICtrlRead($Slider)
    EndIf   
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            $t = GUICtrlRead($Slider)
            IniWrite("transparent.ini","1","transparent",$t)
        Case $msg = $Slider
            GUIDelete($child4)
    EndSelect
WEnd
EndFunc

[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) :)

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...