Jump to content

Increment zecimals in an UpDown control?


Recommended Posts

Lets's say I have this script:

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
;#include <Constants.au3>
;#include <StaticConstants.au3>
$title = "My GUI UpDown"
GUICreate($title,-1,-1,-1,-1, $WS_SIZEBOX)
$input = GUICtrlCreateInput ("2",10,10, 50, 20)
$updown = GUICtrlCreateUpdown($input)

GUISetState ()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
Wend

How could I make the UpDown control increment less then 1...lets say 0.1 or 0.01 or 0.001.........?

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Link to comment
Share on other sites

Lets's say I have this script:

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
;#include <Constants.au3>
;#include <StaticConstants.au3>
$title = "My GUI UpDown"
GUICreate($title,-1,-1,-1,-1, $WS_SIZEBOX)
$input = GUICtrlCreateInput ("2",10,10, 50, 20)
$updown = GUICtrlCreateUpdown($input)

GUISetState ()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
Wend

How could I make the UpDown control increment less then 1...lets say 0.1 or 0.01 or 0.001.........?

Here's one way

#include <GUIConstantsex.au3>
#include <WindowsConstants.au3>
;#include <Constants.au3>
;#include <StaticConstants.au3>
$title = "My GUI UpDown"
GUICreate($title,-1,-1,-1,-1, $WS_SIZEBOX)
$inseen = GUICtrlCreateInput("0.2",10,10,50,20)
$input = GUICtrlCreateInput ("2",59,10, 20, 20)
$updown = GUICtrlCreateUpdown($input)
;GUICtrlSetState($input,$GUI_HIDE)
GUISetState ()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
    if $msg = $updown then 
        GUICtrlSetData($inseen,0.1 * Number(guictrlread($input)))
    EndIf
    
    
Wend
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...