Solved

'checked' property in Microsoft datetimepicker control

Posted on 2012-03-14
2
575 Views
Last Modified: 2012-03-14
I'm trying to include the Microsoft datetimepicker control into a Visual FoxPro form.
I need to be able to include a checkbox into the control, for those occasions when there won't be a date.

I can get the ActiveX control onto the form.

When I come to the properties list, I have an entry for the .CHECKBOX property, which is set to .F. by default. But I can't change this on the PEM list to .T. - am I doing something wrong here?

However, I have found that, within the .INIT() method I can do
    .CHECKBOX = .T.
and the checkbox will appear.

But the most annoying thing is when I'm storing the contents from the control. I'd like to be able to read the state of the checkbox, which I think I ought to be able to do using the .CHECKED property. But (a) that doesn't appear on the PEM list and (b) if I try referring to it programmatically, then I get an error messsage that indicates that .CHECKED doesn't exist.

Any suggestions?
0
Comment
Question by:IainMacb
2 Comments
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 400 total points
ID: 37721313
The Microsoft Date/Time picker for C++ in Visual Studio 2010 has no 'Checked' property.  So perhaps that isn't really a property.

But then a checkbox is a pretty simple strait forward control.  What about simply adding your own check box as a 2nd control.  Then you could modify the datetime picker based on the status of the checkbox and you wouldn't have any limits placed on you by the datetime picker.
0
 
LVL 1

Author Closing Comment

by:IainMacb
ID: 37721382
The perils of Google - I'd ended up with Microsoft's description of the DateTimePicker, at http://http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.checked%28v=vs.80%29.aspx, which does have a .CHECKED property.

The idea of having a separate checkbox was one that had occurred to me, and which I'd started doing before I got waylaid by the wrong documentation!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do I bind a WPF ComboBox to an ItemSource using XAML? 2 28
Add a Condition in ASP Repeater 6 44
Regarding swagger API 1 32
Nested forach loop to linq 3 24
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question