Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

Windows that do not get the focus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Latief - 27 Jun 2006 17:00 GMT
I m trying to write some forms that appear beside Textboxes like the auto
complete window that shows beneath the address bar in IE.
Now i managed to show the window beneath the text box in the same way but my
only problem here is that the window doesnt respond to mouse move events coz
it doesnt have the focus ! , and if it got the focus the form having the
textbox will loose its focus so the cursor will disappear from the textbox
(which means that keypress events will not go to the textbox!).
so how could we make the window capture different mouse events without
having to get the focus ! .
Kevin Spencer - 27 Jun 2006 21:33 GMT
Use a Control instead of a Form. The Control will respond to mouse events.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.

>I m trying to write some forms that appear beside Textboxes like the auto
> complete window that shows beneath the address bar in IE.
[quoted text clipped - 7 lines]
> so how could we make the window capture different mouse events without
> having to get the focus ! .
Stoitcho Goutsev (100) - 28 Jun 2006 14:50 GMT
Kevin,

I don't think he ever said that he is using a form. Form or not all the
controls receives mouse messages and unless the control for some reason
suppress raising the events he should be able to catch them.

The only situations that I can come up with that a control doesn't reveive
mouse events are:
1. The control is covered by other control and the event hadlers are attched
to the control on the bottom.
2. The control is disabled.
3. The mouse is captured by some other control.
4. The message loop doesn't pump messages.

In all other cases the control/form should receive mouse events.

Signature

Stoitcho Goutsev (100)

> Use a Control instead of a Form. The Control will respond to mouse events.
>
[quoted text clipped - 10 lines]
>> so how could we make the window capture different mouse events without
>> having to get the focus ! .
Stoitcho Goutsev (100) - 28 Jun 2006 14:43 GMT
Latief,

Mouse events and the focus are not related. Focused control is the control
that receives the keyboard while the mouse events are send to the control
under the mouse cursor. I believe your problem is somehere else.
Unfortunately without a code that we can play with is really hard to tell
what the prblem might be.

Just for an example the Panel control never gets the focus, but it receives
mouse events.

What type of control are you using for your autocomplete-like window?

--

Stoitcho Goutsev (100)

>I m trying to write some forms that appear beside Textboxes like the auto
> complete window that shows beneath the address bar in IE.
[quoted text clipped - 7 lines]
> so how could we make the window capture different mouse events without
> having to get the focus ! .
Latief - 14 Jul 2006 13:47 GMT
Dear,

Well just try to consider the autocomplete window that appears while ur
writing urls in the IE address textbox , well i m trying to compose a
functionality similar to this one.

1- so when ever a user writes anything in a textbox , a borderless window
just appears beneath the textbox and on top of the current form .
2- unfortunately showing a form will cause it to get the focus.
3- so the focus is moved towards the new borderless window.
4- now for some reasons i need to get the focus back to my textbox that the
user was editing.
5- at this point the main form now has the focus (and the textbox too),  and
the borderless window is on the top but it doesnt have the focus! (so it
doesn't recieve the mouse events )

Sorry for not being able to cut a piece of code.

Latief

> Latief,
>
[quoted text clipped - 24 lines]
> > so how could we make the window capture different mouse events without
> > having to get the focus ! .
Stoitcho Goutsev (100) - 17 Jul 2006 14:37 GMT
Latief,

Have you implemented 1-4 already?
Are you sure about 5? As I said mouse events and the focus are not related.
Borderless form has to recive mouse events, but the main window (with the
edit box) won't reveive them for the area covered by the borderless form.

Signature

Stoitcho Goutsev (100)

> Dear,
>
[quoted text clipped - 53 lines]
>> > so how could we make the window capture different mouse events without
>> > having to get the focus ! .

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.