Jump to content

Recommended Posts

Posted

I tried creating a slider with values between 1 and 8, but I cannot get it to display tickmarks every 1 unit or make its background transparent (I use it in a tab).

$Slider_1 = GUICtrlCreateSlider(20, 100, 120, 30)
GUICtrlSetLimit($Slider_1, 8, 1)
GUICtrlSetData($Slider_1, 8)
GUICtrlSetData($Label_NumberSlider, GUICtrlRead($Slider_1))
GUICtrlSetOnEvent($Slider_1,"NumberSlider")

Func NumberSlider()
    ; Increasing/decreasing the value of the slider.
    GUICtrlSetData($Label_NumberSlider, GUICtrlRead($Slider_1))
EndFunc
Posted

#include <GUIConstants.au3>
#include <GuiSlider.au3>
#include <GuiStatusBar.au3>

$MainGUI = GUICreate("example", 300, 200)
Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
GUISetState()

$Slider_1 = GUICtrlCreateSlider(20, 100, 120, 30)
GUICtrlSetLimit($Slider_1, 8, 1)
GUICtrlSetData($Slider_1, 8)
;~ GUICtrlSetData($Label_NumberSlider, GUICtrlRead($Slider_1))
GUICtrlSetOnEvent($Slider_1,"NumberSlider")
$h_slider = ControlGetHandle($MainGUI, "", "msctls_trackbar321")
_GUICtrlSliderSetTicFreq($h_slider, 1)

While 1
    Sleep(10)
Wend

Func NumberSlider()
    ; Increasing/decreasing the value of the slider.
;~     GUICtrlSetData($Label_NumberSlider, GUICtrlRead($Slider_1))
    ToolTip(GUICtrlRead($Slider_1))
EndFunc

Func Close()
    Exit
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted (edited)

P.S. How do I make the tooltip last only a few seconds? None of the Include files helped answer that question (nor the Help file).

Edit: Argh, scratch that, I found out: If the x and y coordinates are omitted the, tip is placed near the mouse cursor. A Tooltip will appear until the script terminates or ToolTip("") is called.

Edited by Punkie

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
×
×
  • Create New...