Home > Back-end >  TDateTimePicker components in Windows 7
TDateTimePicker components in Windows 7

Time:10-08

TDateTimePicker controls, has two attributes for Checked and ShowCheckBox, indicates whether or not the show selection box, but selection box, normal under XP, Trinidad and Tobago, in Windows 7 problem performance is as follows:

1, when Checked, the default is false, start the program, in principle is to select box is not an option, XP is such, but this is the default choice, no matter how you set properties Checked in advance,

2, click on the drop-down box began to select a date, Windows 7 is to make the selection box automatically check, check whether the selection box has, for example: select box was not checked, if choose to date, the selection box will automatically be selected, under XP is not the case, therefore, when the following code appeared, cannot choose at the time, because the selection has been selected, so has been shows "no",
Procedure TForm1. DateTimePickerChange (Sender: TObject);
The begin
If DP. Checked then
DP. Format:='no'
The else
DP. Format:=' ';
end;
3, if press the code set the display format, if open the skin effect (is XPMan controls put up effect), just check the choice selection box, so long has been shows "no", can no longer continue to other shows,

Above phenomenon under the XP will not appear, but on my Windows 7 system, couldn't thinking, development environment is D7, excuse me, how to solve,

CodePudding user response:

State, make the wrong is the default choice, it is better to change to the following ways can
Procedure TForm1. DateTimePickerChange (Sender: TObject);
The begin
If not DP. Checked then
DP. Format:='no'
The else
DP. Format:=' ';
end;

Leaves 3 o 'clock now, as long as into "no", according to the display format is can't change back, not under XP,
  • Related