By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,376 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,376 IT Pros & Developers. It's quick & easy.

Date Time Pickers...

P: n/a
The example given in msdn.com on how to create a Date Time Picker involves using the CreateWindowEx function. However, I created a dialog box using the graphical interface, and then used the graphical interface to add a Date Time Picker control to it. The only problem is, I don't know how to do anything with the Date Time Picker, like access the date selected within the control. All I have is the ID, which in my code is IDC_DATETIMEPICKER1. Could someone tell me how to get some kind of handle to this control? The msdn example, using the CreateWindowEx function, makes it easy to access a HWND to the Date Time Picker; is there a way I can get a HWND without first using CreateWindowEx? Thanks in advance

NH
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Need Helps" <an*******@discussions.microsoft.com> wrote in message
news:31**********************************@microsof t.com...
The example given in msdn.com on how to create a Date Time Picker involves using the CreateWindowEx function. However, I created a dialog box using the
graphical interface, and then used the graphical interface to add a Date
Time Picker control to it. The only problem is, I don't know how to do
anything with the Date Time Picker, like access the date selected within the
control. All I have is the ID, which in my code is IDC_DATETIMEPICKER1.
Could someone tell me how to get some kind of handle to this control? The
msdn example, using the CreateWindowEx function, makes it easy to access a
HWND to the Date Time Picker; is there a way I can get a HWND without first
using CreateWindowEx? Thanks in advance!
NH


Hmm is this MFC ? Cuz with .Net, a member is automatically generated. IIRC
with MFC this can be done by right-clicking the form or control in design
view and then select "Add member".
Nov 17 '05 #2

P: n/a
"Need Helps" <an
on*****@discussions.microsoft.com> wrote in message
news:31**********************************@microsof t.com...
The example given in msdn.com on how to create a Date Time Picker involves

using the CreateWindowEx function. However, I created a dialog box using the
graphical interface, and then used the graphical interface to add a Date
Time Picker control to it. The only problem is, I don't know how to do
anything with the Date Time Picker, like access the date selected within the
control. All I have is the ID, which in my code is IDC_DATETIMEPICKER1.
Could someone tell me how to get some kind of handle to this control? The
msdn example, using the CreateWindowEx function, makes it easy to access a
HWND to the Date Time Picker; is there a way I can get a HWND without first
using CreateWindowEx? Thanks in advance!

Look up the macros DateTime_SetRange (), DateTime_SetSystemtime () and
DateTime_GetSystemtime () to use the control. The handle can be had if you
know the ID, dlg.GetDlgItem (IDC_DATEPICKER)->m_hWnd.
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.