up-down message'
(UDM_SETRANGE=(&H400+101
(UDM_SETPOS=(&H400+103
(UDM_SETBUDDY=(&H400+105
up-down notification use in wm_notify'
(UDN_FIRST=(-721
(UDN_LAST=(-740
(UDN_DELTAPOS=(UDN_FIRST-1
up-down styles'
UDS_ALIGNRIGHT=&H4
UDS_ALIGNLEFT=&H8
UDS_AUTOBUDDY=&H10
UDS_ARROWKEYS=&H20
UDS_HORZ=&H40
UDS_NOTHOUSANDS=&H80
UDS_HOTTRACK=&H100
msctls_trackbar32 | Slider |
msctls_updown32 | Spinner |
msctls_statusbar32 | StatusBar |
(CreateControls(HWND hwnd
آپ داون جز کامان کنترل هست و باید فراخوان شود .
Dim INITCOMMONCONTROLSEX As icex icex.dwSize= sizeof(INITCOMMONCONTROLSEX)
icex.dwICC=ICC_UPDOWN_CLASS
InitCommonControlsEx &icex
hUpDown= CreateWindowW(UPDOWN_CLASSW, NULL, WS_CHILD | WS_VISIBLE | UDS_SETBUDDYINT | UDS_ALIGNRIGHT, 0, 0, 0, 0, hwnd, (HMENU) ID_UPDOWN, NULL, NULL)
'if create Edit
SendMessageW(hUpDown, UDM_SETBUDDY, (WPARAM)hEdit, 0) SendMessageW(hUpDown, UDM_SETRANGE, 0, MAKELPARAM(UD_MAX_POS, UD_MIN_POS)); SendMessageW(hUpDown, UDM_SETPOS32, 0, 0)
#define UD_MAX_POS 30
#define UD_MIN_POS 0
LPNMUPDOWN lpnmud
case WM_NOTIFY
code=((LPNMHDR) lParam)->code
if (code == UDN_DELTAPOS)
lpnmud = (NMUPDOWN *) lParam
int value = lpnmud->iPos + lpnmud->iDelta
if (value < UD_MIN_POS)
value = UD_MIN_POS
if (value > UD_MAX_POS)
value = UD_MAX_POS
const int asize = 4
wchar_t buf[asize]
size_t cbDest = asize * sizeof(wchar_t) StringCbPrintfW(buf, cbDest, L"%d", value)
(SetWindowTextW(hStatic, buf
break
UDM_SETBUDDY
Sets the buddy window for an up-down control.
Parameters
wParam
Handle to the new buddy window.
lParam
- Must be zero.
Return value
The return value is the handle to the previous buddy window.
NM_UPDOWN
Type LPNMUPDOWN
hdr As NMHDR
iPos As Long
iDelta As Long
End Type
iPos
Type: int
Signed integer value that represents the up-down control's current position.
iDelta
Type: int
Signed integer value that represents the proposed change in the up-down control's position.
Type
NMHDR 'Contains information about a notification message
hwndFrom As Long
idFrom As Long
code As Long
End Type
idFrom
Type: UINT_PTR
An identifier of the control sending the message.
code
Type: UINT
A notification code. This member can be one of the common notification codes (see Notifications under General Control Reference), or it can be a control-specific notification code.