Stop the dropdown of a combobox

sierra467

Registered User.
Local time
Today, 07:39
Joined
Aug 1, 2005
Messages
66
I have a combobox, cboStartDate, that when clicked on opens a Calendar Control 11.0 directly below the combobox. When a date is selected, the Calendar object is hidden and the date is placed in cboStartDate. It works great.

The problem is that if no date is chosen (user selects cboStartDate by accident or decides not to change the date) and the user clicks on the arrow of the combobox to close the calendar, it makes the cboStartDate dropdown a list of options. I do not want that list to appear and am looking for the reverse of the dropdown event.

What is interesting, if the user selects the text portion of the combobox, the dropdown never occurs and it acts just the way I want it to.

So.. does any one know of a command that causes a cbo to remain closed or retract its dropdown list?

Thanks.
 
Maybe set the ListRows property to 1 and lock the control. If dropdown does occur, at least only the current item is visible. User can still scroll the list, however.
If you find a better solution, please post back.
Cheers
 
I'm intrigued, why are you using a drop-down/combo box to activate a calendar control?
 
I'm intrigued, why are you using a drop-down/combo box to activate a calendar control?

I was wondering the same thing. why not just use a button control and a text box that is populated by the calender?
 
The reason I am doing this is because someone asked for it and it seamed easy enough at the time until I got into it. Right now the cbobox is part of a form and it populated from a table that contains dates entered into the table by a person that overlooks the db - yea, I know, not the correct solution, but it is what it is.

So now, I am trying to fix it by keeping the form looking the same, but adding the calendar to get rid of the table that needs to be filled in.

As I said, it all works fine until someone wants to change their mind and not finish what they started. If the cbo arrow is pressed while the calendar is out, it correctly disappears, but the dropdown event occurs and looks poorly.

I tried to set the listrows to 0 but it has to be 1-255. The closest I could come to what I wanted was to use setfocus to put the focus someplace other than the cboStopDate and leave it there, making the user reselect the cboStopDate again if they wanted to RE-change their mind and actually make a change.

I still would love to know if anyone ever finds/makes an anti-dropdown function. I can not seem to do it.
 

Users who are viewing this thread

Back
Top Bottom