Jump to content

[SOLVED] Slider + Input to work in conjunction


Recommended Posts

I'm trying to create a slider/editbox combo, but I'm running into issues...

Moving the slider should change the value in the editbox (I managed to do this easily) but typing numbers into the editbox should adjust the slider position on the fly.

It'd be even better if numbers outside the range of the slider did nothing and made the error beep.

My current code is:

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 633, 447, 192, 124)
Global $Slider1 = GUICtrlCreateSlider(210, 88, 150, 45)
Global $Input1 = GUICtrlCreateInput("0", 385, 96, 121, 21, BitOR($ES_AUTOHSCROLL,$ES_NUMBER))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    GUICtrlSetData($Input1,GUICtrlRead($Slider1))
    Sleep(10)
WEnd

Thanks in advance, I'm sure there's something simple I'm missing...

Edited by montymintypie
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...