Date time picker will not give me time editing in ether state

Date time picker will not give me time editing with time alone
Date time picker will not give me time editing in date time state
In ether state ether state

If DataTypeTextToLBDT(Grid.Cells[1, ARow]) = lbTime then
       begin
        LBRec.LBData := lbTime;
        Keys.GetRec(LastKeyName + LastRecName, LBRec);
        Grid.EditorMode := False;
        DTPicker.Format := 'hh:mm:ss';
        DTPicker.Time := LBRec.Time;
        ViewControl(DTPicker);
        UpdateGrid;
        Exit;
       end;
     If DataTypeTextToLBDT(Grid.Cells[1, ARow]) = lbDateTime then
       begin
        LBRec.LBData := lbDateTime;
        Keys.GetRec(LastKeyName + LastRecName, LBRec);
        DTPicker.Format := 'dd/MMM/yyyy hh:mm:ss';
        DTPicker.DateTime := LBRec.DateTime;
        ViewControl(DTPicker);
        UpdateGrid;
       end;

You must think I’m a pain in the what’s it being picky in my code wanting attention or something ? any way what is a fix for me

Check the TDateTimePicker properties and read the help.

You need to set the Kind property.

is not the controls over kill
I have a format option that is good but if the format dose not include ether date or time
so then the kind is totally unnecessary
Or that if I put a value in the picker of ether date or time or datetime the kind feature should be set accordingly - this is not rocket science stuff.
And you do not have a drop down for time for fast selection
And will not a database date time picker use most of the same code?

If your format doesn’t include either date or time, it’s likely that TDateTimePicker is the wrong control for you.

Log a feature request with Embarcadero. But if you want fast, its probably better to leave the mouse alone and use the keyboard, including up/down keys.

Certainly, and your point is…?

1 Like