uh, hello...

  • Thread starter Thread starter Kenneth P. Graci
  • Start date Start date
K

Kenneth P. Graci

ok all you smart people and low level gurus

how do i detect the close of a combbox's drop down list?

there must be a way and i'm to dumb to figure it out.
 
Hi there,

I took a look at the windows messages that are sent when the combo box
is closed but could not pick out any individual messages for closing the
box. So I'm not sure that checking the windows messages would work, out of
a matter of interest, why are you wanting to know when the box closes?

Nick.
 
Nick,
Sorry, but I was thinking, that when you select an item in a Combo box, it
closes automaticly and could not find other ways to close it.
:-)
Cor
 
Sorry, but I was thinking, that when you select an item in a Combo box, it
closes automaticly and could not find other ways to close it.

Yup, I understand, I wasn't having a pop honest :-) I'm just not sure what
he wants it for, I took a look at the windows messages etc and couldn't find
a way (maybe I'm just dumb, quite possible).

Nick.
 
respectfully yes and thank you, and i'm sorry i missed the post

i am aware of the SelectedIndexChanged event but i thought it inadequate for
my purpose because it fired as the user scrolls through the list.

i am now thinking that i can test to see if the list is droped down, and if
so ignore the event.

i am trying to force the uses to drop the list down and click or press enter
to slelect an item, that is, i want to supress the ability for the user to
use the arrow keys to change the selection when the list is not dropped
down, and i want to ignore SelectedIndexChange when the list is dropped
down.

the net result is to ignore changes until the users has actually setteled on
a final selection yet not delay the processing by waiting until after the
user pressed tab to lose focus.

what brought this all about was a problem i encountered. the user is
selecting a client with the combobox and i have a lot of objects being
created and databases being queryed when the selection is made. as the user
scrolls through the selections the code was being run and the user would see
the result on the screen. this processing was unnecessary but not
detrimental, but after rapid changes (holding down the arrow key, for
example) i would get an "unspecified error" when trying to read the
database. the condition was terminal and the appliaction must be exited to
"reset" things.

my final solution (in theroy) was to desing a comboxbox that only fired the
"Change" event when the user was done browsing, signified by the close of
the drop down list.

hey, i'm a fun loving guy, but i (wronly) got fustrated when more discussion
is drawn concerning the theoritical inconsistancies of the concatenation
oprerator (who cares?).

peace
 
hey, i'm a fun loving guy, but i (wronly) got fustrated when more
discussion
is drawn concerning the theoritical inconsistancies of the concatenation
oprerator (who cares?).

It's nothing personal. Do you not find the discussion highly entertaining?
I dream at night of discussions about string concatenation.....

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Having problems with you job?
You're marriage is on the rocks?
You can't sleep at night?
You have a drink and drugs addiction?
You are sexually impotent?
Then enable Option Strict!
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
A method I've used successfully in the past is to start a timer when the
Change event is fired. Then put the time-consuming work in the timer event
(or call it from the timer event). The timer interval can be adjusted to
balance tolerance for rapid selection with responsiveness.

Just a thought.

Vincent
 
If you'd used Option Strict On.... (SCNR)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
 
Hi Nick,

||vb.net - windows forms
||
||I need to know when the dropdown list on my
||derived combobox closes.
||
||There is a DropDown event and a OnDropDown
||override, but I want to know when it closes.
||
||It is an ownerdrawn combobox, so i am handling
||the Drawitem event myself. DrawItem, however,
||does not always get called when the list closes,
||only when something needs drawn.
||
||I have trapped the several flovors of the
||PreProcessMessage events but none of them
||fire when the user clicks the list to make
||it close.
||
||any ideas?

Kenneth posted this yesterday but (presumably) no-one picked up on
the title he gave it: "ComboBox Un-DropDown event?" so he came bak
today with "uh, hello" and caught himself some help! I reckon there
must something in that marketing lore that says "it's all in the
packaging". :-)

Regards,
Fergus
 
Hi Kenneth,

The list gets closed:
When the following keys are pressed:
<Alt-Up>, <Esc>, <Enter>,
<Tab> (which triggers the Leave event)
When the Edit box is clicked.
When the same item in the List is clicked.
When a different item in the List is clicked.
When any other control is clicked (Leave event again)

There may be more that I haven't discovered.

You say that you're handling the DrawItem event so I guess that
some of the above are triggering it and some are not. I reckon you'll
have to give up chasing the list-close itself and focus on the events
that give rise to it.

Regards,
Fergus
 
A method I've used successfully in the past is to start a timer when the
Change event is fired.

yeah, i've done that before too. i always felt this was kind of a hack (it
just 'seems' wrong).

anyway, i've solved my problem by restricting the user's ability to change
the selection without a dropdown box, and then raising my new
"SelectionChanged" event on <CR>, LostFocus, and SelectedIndexChanged when
the list is not dropped down.

works pretty good too, in that is acts in accordance with what the user
expects to happen.

who changes a combox box with the arrow keys without the list dropped down
anyway? i always thought that behavior was kind of dangerous, the user can
easily corrupt a field with an arrow key thinking they would move focus to
another field.

thanks
i'm now a little less dumb
 
If you'd used Option Strict On.... (SCNR)

Provider of life :-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Having problems with you job?
You're marriage is on the rocks?
You can't sleep at night?
You have a drink and drugs addiction?
You are sexually impotent?
Then enable Option Strict!
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Back
Top