Combobox doesn't work if the form has TopMost = true

B

brianushman

If I have a combobox on a form and that form's property TopMost is set
to true, the comboxbox doesn't work. I'll click on the combobox and
it won't drop down, even though all the properties for the combobox
are correct. If I change TopMost = false, then the combobox works.
Can anyone explain why this is and how I can possibly fix it? Thank
you much!
 
S

Stanimir Stoyanov

Hm, can you paste the necessary part of your form code (including designer
code) to reproduce the issue?

There is no reason I can think of why the dropdown will not show.
 
B

Ben Voigt [C++ MVP]

A combobox opens by displaying a listbox marked topmost so it appears on top
of your form. If your form is also topmost then the listbox won't
necessarily stay above your form. Are you doing anything in a timer or a
cross-thread invoke that would put your form to the front?
 
J

Jeff Johnson

If I have a combobox on a form and that form's property TopMost is set
to true

Why? How life-or-death critical is this application? If the answer is "not
at all," then using TopMost is just an abuse of the property.
 
J

Jeff Johnson

Why? How life-or-death critical is this application? If the answer is "not
at all," then using TopMost is just an abuse of the property.

Argh, I sent that too quickly. I meant to add that if you need this form to
stay above all other forms IN YOUR APPLICATION, then there are better ways
of going about it than setting TopMost.

Making a form stay above all other windows in the entire system is usually
the result of developer rudeness, arrogance, or ignorance as opposed to
necessity.
 
B

Bjørn Brox

Jeff Johnson skrev:
Argh, I sent that too quickly. I meant to add that if you need this form to
stay above all other forms IN YOUR APPLICATION, then there are better ways
of going about it than setting TopMost.

Making a form stay above all other windows in the entire system is usually
the result of developer rudeness, arrogance, or ignorance as opposed to
necessity.
Agree, I hate such applications, and even worse is the applications that
steals focus and worst of all move your mouse position to focus on the
application.

May be in the last century people was just doing one ting at the same
time on the computer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top