How to control date format in combo

  • Thread starter Thread starter Steve Marshall
  • Start date Start date
S

Steve Marshall

Hi All,

This SHOULD be simple, but I just can't see it...

I have a combo box which uses a dataset as its list source. The
displayed member is a date column from the underlying table. When I
run it, the date in the combo is formatted as d/m/yyyy hh:mm:ss, which
I don't want - I just want the date part. How can I control the format
of the date? Do I have to delve into owner-drawing? Surely not!

Thanks
 
Steve Marshall said:
I have a combo box which uses a dataset as its list source. The
displayed member is a date column from the underlying table. When I
run it, the date in the combo is formatted as d/m/yyyy hh:mm:ss, which
I don't want - I just want the date part.

Why not use a datetimepicker control instead of the textbox?
 
Thanks for the reply. It's not a textbox, it's a combo. I had already
tried a DateTimePicker, but found that it generated ValueChanged events
every time something is clicked in it (which is reasonable) - I want
just one event when a date is finally selected, not an event every time
the day, month or year is changed. I tried using the LostFocus event
on the DateTimePicker, but that event seems to get fired every time
something changes too.

And anyway, the date needs to be selected from those in the underlying
table, so it has to be something that allows that.
 
Back
Top