Sign in to follow this  
Followers 0
BigDaddyO

How to Set Data in a VB.NET DateTime Picker

1 post in this topic

#1 ·  Posted (edited)

Hello,

I am attempting to set the date in a date/time picker box that is in a VB.net application. I found the information below on microsofts web site on how to set the date but I can't figure out how to convert it into AutoIT.

Any help is appreciated.

Mike

DateTime_SetSystemtime Macro

Sets a date and time picker (DTP) control to a given date and time. You can use this macro or send the DTM_SETSYSTEMTIME message explicitly.

Syntax

BOOL DateTime_SetSystemtime(

HWND hwndDT,

DWORD flag,

LPSYSTEMTIME lpSysTime

);

Parameters

hwndDT

Handle to a DTP control.

flag

Value that specifies the action that should be performed. This should be set to one of the following values:

GDT_VALID

Set the DTP control according to the data within the SYSTEMTIME structure pointed to by lpSysTime.

GDT_NONE

Set the DTP control to "no date" and clear its check box. When this flag is specified, lpSysTime is ignored. This flag applies only to DTP controls that are set to the DTS_SHOWNONE style.

lpSysTime

Pointer to a SYSTEMTIME structure that contains the system time information by which to set the DTP control.

Return Value

Returns nonzero if successful, or zero otherwise.

Macro Information

Minimum DLL Version comctl32.dll version 4.70 or later

Header commctrl.h

Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0

Or maybe this???

lResult = SendMessage( // returns LRESULT in lResult

(HWND) hWndControl, // handle to destination control

(UINT) DTM_SETSYSTEMTIME, // message ID

(WPARAM) wParam, // = (WPARAM) (DWORD) flag;

(LPARAM) lParam // = (LPARAM) (LPSYSTEMTIME) lpSysTime;

);

Parameters

flag

Value specifying the action that should be performed. This value must be set to one of the following:

GDT_VALID

Set the DTP control according to the data within the structure that lpSysTime points to.

GDT_NONE

Set the DTP control to "no date" and clear its check box. When this flag is specified, lpSysTime is ignored. This flag applies only to DTP controls that are set to the DTS_SHOWNONE style.

lpSysTime

Pointer to a SYSTEMTIME structure containing the system time used to set the DTP control.

Return Value

Returns nonzero if successful, or zero otherwise.

Edited by MikeOsdx

Share this post


Link to post
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
Sign in to follow this  
Followers 0