Creates an Ocx UpDown control in the current active form, window, or dialog.
Ocx UpDown name [= text$] [, id%] [, x, y, width, height] [, style%]
text$:control text
id%:control identifier
x, y, width, height:iexp
style%:the control styles
An UpDown control has a pair of arrow buttons which the user can click to increment or decrement a value, such as a scroll position or a value in an associated control, known as a buddy control.
To the user, an UpDown control and its buddy control often look like a single control. The buddy control can be any control that can be linked to the UpDown control through the BuddyControl property, and usually displays data, such as a TextBox control or a Command control.
The text of the buddy control is determined by the UpDown OCX using the Format property.
The UpDown control can be positioned to the right (default) or left of its buddy control with the LeftAlign property. The BuddyControl property sets or returns the Ocx control used as the buddy control. The arrows may be positioned vertically (default) or horizontally with the Horizontal property.
The Increment, Min, Max, and Wrap properties specify how the UpDown control's Value property changes when the user clicks the buttons on the control. For example, if you have values that are multiples of 10, and range from 20 to 80, you can set the Increment, Min, and Max properties to 10, 20, and 80, respectively. The Wrap property allows the Value property to increment past the Max property and start again at the Min property, or vice versa.
The Value property specifies the current value within the range of the Min and Max properties. This property is incremented or decremented when the arrow buttons are clicked. The settings of the Min and Max properties determine whether the value is incremented or decremented when the arrow buttons are clicked.
The ArrowKeys property determines the purpose of the up and down arrow keys in the buddy control. When ArrowKeys is True, it causes the up-down control to increment and decrement the position when the UP ARROW and DOWN ARROW keys are pressed.
The Change event occurs whenever the Value property changes. The Value property can change through code, or by clicking the arrow buttons.
ArrowKeys | BuddyControl, | Enabled | Format | Height | Width | HelpContextID | Horizontal | hWnd | Increment | Index | Left | Top | LeftAlign | Max | Min | MouseCursor | MouseIcon | MousePointer | Name | Parent | Tag | ToolTiptext | Value | Visible | WhatsThisHelpID | Wrap
Change | DownClick | MouseDown |MouseUp | MouseMove |UpClick
Form frm1 = "UpDown", , , 200, 200
Ocx TextBox tbu = "??", 5, 5, 150, 24
.Appearance = 1
Ocx UpDown updn
.BuddyControl = tbu
.Max = 10
.Increment = 0.5
.Format = "0.0"
.Value = 2.5
Do
Sleep
Until Me Is Nothing
See Also UpDownOcx.g32
An UpDown control without a buddy control functions as a sort of simplified scroll bar.
Animation, CheckBox, ComboBox, Command, CommDlg, Form, Frame, Image, ImageList, Label, ListBox, ListView, MonthView, Option, ProgressBar, RichEdit, Scroll, Slider, StatusBar, TabStrip, TextBox, Timer, TrayIcon, TreeView
{Created by Sjouke Hamstra; Last updated: 07/10/2017 by James Gaite}