473,378 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Un Dropping Down a Drop Down

I have an application I am developing that has a Combo Box that is
intended to show a list of available tables in the selected DSN. I
have put code in the control's DropDown event handler to clear the
item list and reload it from the currently specified DSN (in a Text
Box control on the same form). This works well.

BUT ... if the specified DSN is invalid, I can display an appropriate
error message, but then then empty dropdown list is still displayed. I
have tried to suppress it by setting the control's DroppedDown
property to false if the error is encountered, but the empty dropdown
list is still being displayed and I have to click on the dropdown
button again to make it go away. What is also interesting is when I
click on the dropdown button to make it go away, the DropDown event
does not fire, only when it is first clicked.

So, how do I un-drop down a drop down?

Jul 25 '07 #1
6 2351

If there is an error, you could just hide the drop down list to prevent the
user from using it.

Adrian.
--
[Please mark my answer if it was helpful to you]


"za***@construction-imaging.com" wrote:
I have an application I am developing that has a Combo Box that is
intended to show a list of available tables in the selected DSN. I
have put code in the control's DropDown event handler to clear the
item list and reload it from the currently specified DSN (in a Text
Box control on the same form). This works well.

BUT ... if the specified DSN is invalid, I can display an appropriate
error message, but then then empty dropdown list is still displayed. I
have tried to suppress it by setting the control's DroppedDown
property to false if the error is encountered, but the empty dropdown
list is still being displayed and I have to click on the dropdown
button again to make it go away. What is also interesting is when I
click on the dropdown button to make it go away, the DropDown event
does not fire, only when it is first clicked.

So, how do I un-drop down a drop down?

Jul 26 '07 #2

Maybe: ComboBox.Refresh
"za***@construction-imaging.com" wrote:
I have an application I am developing that has a Combo Box that is
intended to show a list of available tables in the selected DSN. I
have put code in the control's DropDown event handler to clear the
item list and reload it from the currently specified DSN (in a Text
Box control on the same form). This works well.

BUT ... if the specified DSN is invalid, I can display an appropriate
error message, but then then empty dropdown list is still displayed. I
have tried to suppress it by setting the control's DroppedDown
property to false if the error is encountered, but the empty dropdown
list is still being displayed and I have to click on the dropdown
button again to make it go away. What is also interesting is when I
click on the dropdown button to make it go away, the DropDown event
does not fire, only when it is first clicked.

So, how do I un-drop down a drop down?

Jul 26 '07 #3
On Jul 25, 11:32 pm, Tracks <Tra...@discussions.microsoft.comwrote:
Maybe: ComboBox.Refresh
Thenks, but it didn't help.
>
"za...@construction-imaging.com" wrote:
I have an application I am developing that has a Combo Box that is
intended to show a list of available tables in the selected DSN. I
have put code in the control's DropDown event handler to clear the
item list and reload it from the currently specified DSN (in a Text
Box control on the same form). This works well.
BUT ... if the specified DSN is invalid, I can display an appropriate
error message, but then then empty dropdown list is still displayed. I
have tried to suppress it by setting the control's DroppedDown
property to false if the error is encountered, but the empty dropdown
list is still being displayed and I have to click on the dropdown
button again to make it go away. What is also interesting is when I
click on the dropdown button to make it go away, the DropDown event
does not fire, only when it is first clicked.
So, how do I un-drop down a drop down?- Hide quoted text -

- Show quoted text -

Jul 26 '07 #4
On Jul 26, 8:40 am, za...@construction-imaging.com wrote:
On Jul 25, 11:32 pm, Tracks <Tra...@discussions.microsoft.comwrote:
Maybe: ComboBox.Refresh

Thenks, but it didn't help.
"za...@construction-imaging.com" wrote:
I have an application I am developing that has a Combo Box that is
intended to show a list of available tables in the selected DSN. I
have put code in the control's DropDown event handler to clear the
item list and reload it from the currently specified DSN (in a Text
Box control on the same form). This works well.
BUT ... if the specified DSN is invalid, I can display an appropriate
error message, but then then empty dropdown list is still displayed. I
have tried to suppress it by setting the control's DroppedDown
property to false if the error is encountered, but the empty dropdown
list is still being displayed and I have to click on the dropdown
button again to make it go away. What is also interesting is when I
click on the dropdown button to make it go away, the DropDown event
does not fire, only when it is first clicked.
So, how do I un-drop down a drop down?- Hide quoted text -
- Show quoted text -
Alt + Down will toggle the drop down list up or down so you could
experiment with either SendKeys.Send or even try using the SendMessage
API to tell the combobox's handle to try to force the drop down to
hide.

Good Luck!

Thanks,

Seth Rowe

Jul 26 '07 #5
IIRC, setting DroppedDown in the handler is too soon, and it doesn't
work. You could try adding a delay, either using this.BeginInvoke, or
a short timer?

Marc

Jul 26 '07 #6
On Jul 26, 9:14 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jul 26, 8:40 am, za...@construction-imaging.com wrote:


On Jul 25, 11:32 pm, Tracks <Tra...@discussions.microsoft.comwrote:
Maybe: ComboBox.Refresh
Thenks, but it didn't help.
"za...@construction-imaging.com" wrote:
I have an application I am developing that has a Combo Box that is
intended to show a list of available tables in the selected DSN. I
have put code in the control's DropDown event handler to clear the
item list and reload it from the currently specified DSN (in a Text
Box control on the same form). This works well.
BUT ... if the specified DSN is invalid, I can display an appropriate
error message, but then then empty dropdown list is still displayed. I
have tried to suppress it by setting the control's DroppedDown
property to false if the error is encountered, but the empty dropdown
list is still being displayed and I have to click on the dropdown
button again to make it go away. What is also interesting is when I
click on the dropdown button to make it go away, the DropDown event
does not fire, only when it is first clicked.
So, how do I un-drop down a drop down?- Hide quoted text -
- Show quoted text -

Alt + Down will toggle the drop down list up or down so you could
experiment with either SendKeys.Send or even try using the SendMessage
API to tell the combobox's handle to try to force the drop down to
hide.
The Alt Down does work from the keyboard. So I put an:

SendKeys.Send("%{down}")

in the DropDown event error branch, but alas, it does not appear to
have any effect.

It's almost like the dropdown occurs AFTER and user code in the
DropDown event, and there is not a DroppedDown event to put code in to
undrop it.

ARGHHH!

Jul 26 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rob Baxter | last post by:
I have a linux server which is hosting several very large (~20GB) databases. In order to save some disk space I dropped an index on one of the larger (InnoDB) tables because it is no longer needed....
5
by: joe | last post by:
I have an image database that I'd like to populate by dragging an image off the desktop and dropping onto a form (cut/paste would work equally as well) Any suggestions? Thanks, Joe
3
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
2
by: Scott | last post by:
Hi, I need to programmatically drop the .NET DateTimePicker calendar. I did this in VB6 by doing the following: SendMessage DTDateTime.hwnd, WM_KEYDOWN, VK_F4, 0 This worked because the F4...
7
by: Ross Mallett | last post by:
I have to drop large numbers of test tables (> 200) fairly often. This operation seems to be very slow. Is there some way to speed up the process of dropping tables?
8
by: sat | last post by:
hi all! I have a doubt regarding the dropping of a column. As i've seen, we have an option like "alter table <table namedrop column <column name>" in oracle. Do we have any method in db2 to drop...
6
by: zacks | last post by:
I have an application I am developing that has a Combo Box that is intended to show a list of available tables in the selected DSN. I have put code in the control's DropDown event handler to clear...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.