Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Components Writing > Custom dropdown...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 76 of 155
Post > Topic >>

Custom dropdown control

by vocalise27@[EMAIL PROTECTED] (Leslie) Jul 12, 2004 at 01:06 AM

Dear Sirs, I'm writing a custom dropdown control. The base is a button
(BitBtn), its OnClick event pops up (or rather: drops down) a little
borderless window, with a TrackBar on it.

To show the dropdown form, I use:

SetWindowPos(myForm.Handle, 
           HWND_TOP, 
           myForm.Left, 
           myForm.Top, 
           0, 
           0,
           SWP_NOSIZE or SWP_NOACTIVATE or SWP_SHOWWINDOW);
myForm.Visible := True;
myForm.Invalidate;

With this, the dropdown shows up, but it doesn't take the focus away
from the main form (=parent of my control). When someone uses the
TrackBar, then clicks elsewhere (so that the dropdown loses focus), I
hide the dropdown using the OnDeactivate event.

BUT: other professional dropdown controls can do this: I click the
button (and it will have the focus), the dropdown shows up, doesn't
take the focus from the parent form, and when I click anywhere on the
parent form (without ever giving the focus to the dropdown!), the
dropdown disappears. Even if I click on the title bar of the parent
window, which does not take away the focus from my button I just
clicked, the dropdown form knows it needs to disappear! How can this
be done?

In other words: the custom control knows that I clicked on the parent
form, even if the button retains the focus, and the dropdown form
itself doesn't have the focus. Can anyone tell me how it is done?
 




 2 Posts in Topic:
Custom dropdown control
vocalise27@[EMAIL PROTECT  2004-07-12 01:06:47 
Private Message
   2004-07-12 04:55:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 18:32:24 CDT 2008.