Date Picker Sample Problem? |
Post Reply |
Author | |
John31
Groupie Joined: 08 December 2005 Location: United States Status: Offline Points: 70 |
Post Options
Thanks(0)
Posted: 07 April 2006 at 3:04pm |
In the DatePickerSample (VB6) the behavior of the cmbPopUp seems wrong to me. Specifically, if there is a date in the combo box and you click the drop down button the date is displayed in the data picker. All good so far. If the user then clicks the drop down again the date picker closes and the value in the cmbPopUp is cleared. I have tried all sorts of stuff so that the value in the cmbPopUp remains the same as before but I cannot get it to work. Any ideas on how to make it retain the previous value?
|
|
Regards
John Layton |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi John,
It is a desired behavior. If you look into cmbPopUp_DropDown() method, you can see that combo box text is set only if something was choosen inside the date picker. If there was an outside click, or Escape button pressed, ShowModal method returns False and combo text is cleared. You can change the sample logic in any way you'd like, just note that ShowModal returns True only if user has chosen some date and False if cancelled a popup. -- WBR, Serge |
|
John31
Groupie Joined: 08 December 2005 Location: United States Status: Offline Points: 70 |
Post Options
Thanks(0)
|
I am aware of the logic used in the sample. However, take the following modification to the code which should allow for restoring the original value into the combo, but it does not work. The DatePicker is cause the value to be removed. If you step through the code it works fine, but when you run it with no breaks the value is not restored. Private Sub cmbPopUp_DropDown() |
|
Regards
John Layton |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
The main idea is to restore text after exit from cmbPopUp_DropDown
.
To resolve this problem I add a timer object to the form:
popupTimer
Disabled by default, Timeout = 10 ms.
-- WBR, Serge |
|
John31
Groupie Joined: 08 December 2005 Location: United States Status: Offline Points: 70 |
Post Options
Thanks(0)
|
I implemented something similar to solve the problem after looking at various subclassing options. The paint of the drop down after a date is selected is very annoying. It makes the solution look like a hack rather and does not follow the professional style of all your other controls. I would love to see you add a fully implemented Combo Box Date Picker as an optional control so that this type of paint issue does not occur. Keep up the good work!
|
|
Regards
John Layton |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |