Board index » cppbuilder » DateTimePicker UpDown buttons

DateTimePicker UpDown buttons


2006-01-06 10:43:54 PM
cppbuilder112
Hi!
The DateTimePicker control, contains an UpDown Button if the property
kind is set to dtkTime.
My Question is:
"Is it possible to test wether up/down button is clicked?"
Thanks a million!
 
 

Re:DateTimePicker UpDown buttons

Paw Suddergaard wrote:
Quote
"Is it possible to test wether up/down button is clicked?"
Just compare the actual value with the one before.
void __fastcall TForm1::DateTimePicker1Change(TObject *Sender)
{
static TDateTime DateTime = 0;
if ( (int)DateTime )
{
if ( DateTime < DateTimePicker1->DateTime )
Label1->Caption = "Up";
else
Label1->Caption = "Down";
}
DateTime = DateTimePicker1->DateTime;
}
This will tell you from the second click on. If you need it to
work from the first click on then change the static variable
to, for instance, a private one and populate at startup.
Hans.