Solved

'checked' property in Microsoft datetimepicker control

Posted on 2012-03-14
2
571 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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