Solved

'checked' property in Microsoft datetimepicker control

Posted on 2012-03-14
2
579 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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