Jump to content

Custom Slider


 Share

Recommended Posts

;~ Volume
$Volume = GuiCtrlCreateSlider(0, 210, 75, 20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

GuiCtrlCreateLabel("Volume", 0, 200, 40, 15)
GUICtrlSetColor(-1,0x000000)    ; Gray
GUICtrlSetBkColor(-2, $GUI_BKCOLOR_TRANSPARENT)


Case Else
                If GUICtrlread($Volume) <> $VolLevel Then
                    $oMediaPlaySettings.Volume = GUICtrlRead($Volume)
                    $VolLevel = GUICtrlRead($Volume)
                EndIf

The Above script isn't complete I know But this is the Volume parts.

So how can I make it look more like the Picture. There has to be a way. I need the ball to move and the Volume to be controled by the ball.

Please Help

post-8340-1170319697_thumb.jpg

Link to comment
Share on other sites

Okay I was playing around and was able to make the ball move. Now how can I make it so it stays on the bar and can not go past the bar.

#include <Array.au3>
#include <File.au3>
#include <GuiConstants.au3>
#Include <GuiEdit.au3>
#include <Misc.au3>
#include <GuiList.au3>
AutoItSetOption('MouseCoordMode',2)
GUICreate("Test")

GUICtrlCreatePic("bar.gif",30,50,0,0)
$ball = GUICtrlCreatePic("ball.gif",50,60,0,0)


GUISetState()
$msg = 0
While 1
     $msg = GUIGetMsg()
Select
   
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    Case $msg = $ball
    while MouseClick("left")
    Do
    $pos = MouseGetPos()
    ControlMove ( "", "", $ball, $pos[0],$pos[1]  )
    Until MouseClick("left")
ExitLoop
WEnd


EndSelect
WEnd
Link to comment
Share on other sites

Okay here is the Completed Program

Here is the Link

If you find a bug please let me know

Here is a Screen Shot of the Player

Posted Image

It takes the XML File and splits the data then it takes the Slider that was worked on from Above and puts it to use as a Volume Control.

Thanks to everyone for your help it turned out just like I wanted

Edited by eagle4life69
Link to comment
Share on other sites

  • 5 years later...
  • Moderators

Hi, n1maS. It is generally not a good idea to resurrect such an old post. AutoIt is a constantly evolving language; what worked in 2007 is not likely to work the same now. You will likely get a much better response from forum members if you:

  • read the forum rules and ensure what you're trying to do doesn't violate them.
  • create a new topic of your own
  • explain in detail what you are trying to accomplish
  • provide code you have tried already (even if it doesn't work)
  • understand that it may take some time for someone to respond (wait at least 24 hours)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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