Hi.
I have a tough one for you guru's.:confused:
Does anyone know how to display 2 forms, both having focus?
Actually, the backgroundform doesn't need the focus, but the titlebar should still be drawn with focus.
See pictures.
Printable View
Hi.
I have a tough one for you guru's.:confused:
Does anyone know how to display 2 forms, both having focus?
Actually, the backgroundform doesn't need the focus, but the titlebar should still be drawn with focus.
See pictures.
Hi,
"Does anyone know how to display 2 forms, both having focus?
Actually, the backgroundform doesn't need the focus, but the titlebar should still be drawn with focus"
If a form is in focus it means that it is the sole recipient of all keyboard activity. You can only have one form being the sole recipient. What are you trying to achieve? If you simply want the title bar of a form not in focus to appear the same shade as the title bar of the form in focus, you simply use the MDI/Child process. In this case, any controls you place on the MDI Parent will show through the child and will respond to a mouse click.
You may be confusing this issue with the Screen Object reference in VBA, where you can refer in code to both the object currently in focus and the object previously in focus (but you can refer in VB code to any object, whether or not it is in focus).
Hi.
What I'm trying to make is a custom combobox that can be used as a control container.
To do this I want to make a form containing the control, and let the form be the dropdown portion of my combobox.
I reckon I need a form to be my control container, because it should be able to expand bound the boundaries of my parent form. Just like the date and time picker.
My problem is, that if I use a form for this, my parent form looses focues, until my combo is closed again. But the normal combo's and the date and time picker, can expand outside my parent without my parent looses focus.
That's why my parent form doesn't need the focus, but should still be painted as if it did.
If anyone now of another way, I would very much like to hear about it. I tried to inherits a panel, and set it to TopLevel, but that wasn't showing at all.
But thanks anyway, taxes.
Hi,
I still do not understand precisely what you are trying to achieve.
Immediately a combobox loses focus, the dropdown portion disappears( unless the Style property is set to Simple). It is not a question of the combobox closing. So if you want to set focus on the "parent form" (as you put it), are you saying that you want the dropdown list to remain visible? If so, set Style to Simple.
If you are using the MDI Parent/Child approach why do you not want to use scroll bars on the dropdown list? (which would allow you to view the contents of that list without leaving the boundaries of the parent.)
Hi.
It's not a question on how to and when to close a combobox.
Try making a form with a date and time picker at the bottom of the form.
When you open the date and time picker, the calander part expands outside the form, but the form is still drawn as the active window.
That's exactly what I wan't to do. I want to have a control that can exceed the boundaries of it's parent.
I hope this explains it better (It's kind a hard to explain in writting:D )
Hi PAx,
Have you noticed that, in the case of the DateTimePicker, the Container form loses focus during the time the key is depressed on selecting a date? Is it possible that it is the form which is solely in focus until the key down event of the datetimepicker - regaining focus on keyup?
Damn it. You are absolutely right.
I haven't seen that.
So it appears that they open the dropdown portion without focus, and when clicked, it returns focus to the form. This happens so fast that you will only notice it when you hold the mouse down, and not when clicking normally.
Well I guess that's the way to go.
Thanks for all your time Taxes, you've been a great help.
Hi Pax,
Pleasure.
We've both learned from this.
regards,
Hi Taxes.
Just Info. I just thought you'd want to now.
If you use the LockWindowUpdate API before you open the DropDownForm, and then use LockWindowUpdate(IntPtr.Zero) when closing the DropDownForm, it works like a charm.
Hi.
Just thought I wanted to present the solution.
The Lockwindowupdate only works on Win2K or XP without themes. (that's no fun...)
I found this article on http://www.vbaccelerator.com, so no credits to me.