Date Time Pickers...

G

Guest

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
 
M

Michiel

Need Helps said:
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!

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".
 
M

Matt Osborn

"Need Helps" <an
(e-mail address removed)> wrote in message
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top