Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread TDateEditComboBox and Text editing
Fri, Mar 13 2020 7:50 AMPermanent Link

Matthew Jones

I have a TDateEditComboBox on my form. I can type a date and it sits there happily. But if I ask for "SelectedDate" then it gives me today, and not the date typed in. If I select a date using the drop down, SelectedDate gives me that date. Can the combo automatically interpret the typed date, or must I code it myself?

--

Matthew Jones
Sat, Mar 14 2020 8:03 AMPermanent Link

Bruno Larochelle

Hi Matthew

Did you mean to post this in the beta forum for v3?

I tried what you describe.. I can confirm that this is what occurs with v3, but v2 appears to work correctly.. it picks up a manually edited date.

.. Bruno

"Matthew Jones" wrote:

I have a TDateEditComboBox on my form. I can type a date and it sits there happily. But if I ask for "SelectedDate" then it gives me today, and not the date typed in. If I select a date using the drop down, SelectedDate gives me that date. Can the combo automatically interpret the typed date, or must I code it myself?

--

Matthew Jones
Sun, Mar 15 2020 7:33 AMPermanent Link

Matthew Jones

Bruno Larochelle wrote:

> I tried what you describe.. I can confirm that this is what occurs with v3, but v2 appears to work correctly.. it picks up a manually edited date.

That's interesting - it doesn't work for me! I had to manually set it in an OnChange event handler. And thanks for checking, but I'm working on about to go live code, so not using EWB3 (other than a test whizz the other day).

--

Matthew Jones
Sun, Mar 15 2020 8:00 AMPermanent Link

Bruno Larochelle

My test did not have a dataset tied to the calendar control.. does yours?

My test was super simple.. a TDateEditCombo, and a showMessage:

..
cmbMain: TDateEditComboBox;
..
showMessage(DateToStr(cmbMain.selectedDate));
..



"Matthew Jones" wrote:

Bruno Larochelle wrote:

> I tried what you describe.. I can confirm that this is what occurs with v3, but v2 appears to work correctly.. it picks up a manually edited date.

That's interesting - it doesn't work for me! I had to manually set it in an OnChange event handler. And thanks for checking, but I'm working on about to go live code, so not using EWB3 (other than a test whizz the other day).

--

Matthew Jones
Sun, Mar 15 2020 11:04 AMPermanent Link

Matthew Jones

Bruno Larochelle wrote:

> My test was super simple.. a TDateEditCombo, and a showMessage:
>
> .
> cmbMain: TDateEditComboBox;
> .
> showMessage(DateToStr(cmbMain.selectedDate));
> .


I shall have to play further. Part of the problem may be, but I don't think it is, that I have utility code that changes ShortDateFormat to get the dates for transfer, and I have them set it back now. But I don't think it is that.

Right now though the manual solution is working, and I'm swamped, so not sure I'll put a lot of effort in though. Good to know that it can work though!

--

Matthew Jones
Image