468,478 Members | 2,385 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,478 developers. It's quick & easy.

Send form mouse messages to a control on it automatically?

I have a control on a form.

Is there a way the control can receive the mouse messages that the form
would normally get?

I know the form could just call a method on the form but wonder if that is
the best way?

Thanks
Nov 20 '05 #1
8 782
* " SamSpade" <st**************@REMOVEaol.com> scripsit:
I have a control on a form.

Is there a way the control can receive the mouse messages that the form
would normally get?

I know the form could just call a method on the form but wonder if that is
the best way?


Call the control's 'FindForm' method to get a reference to the form the
control is placed on. Then use 'AddHandler' to add a handler to the
form's events.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #2
I just posted a question about a control setting its form to be OnTop.
I think your answer to this will also work for that

Thanks

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c2*************@ID-208219.news.uni-berlin.de...
* " SamSpade" <st**************@REMOVEaol.com> scripsit:
I have a control on a form.

Is there a way the control can receive the mouse messages that the form
would normally get?

I know the form could just call a method on the form but wonder if that is the best way?


Call the control's 'FindForm' method to get a reference to the form the
control is placed on. Then use 'AddHandler' to add a handler to the
form's events.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>

Nov 20 '05 #3
* " SamSpade" <st**************@REMOVEaol.com> scripsit:
I just posted a question about a control setting its form to be OnTop.
.... and I replied...
I think your answer to this will also work for that


:-)

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #4

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c2*************@ID-208219.news.uni-berlin.de...
* " SamSpade" <st**************@REMOVEaol.com> scripsit:
I just posted a question about a control setting its form to be OnTop.
... and I replied...

No there was a second one about a control setting the form to OnTop, but it
seems to have gone off by itself somewhere. Good thing because FindForm
(which I saw right after sending) solved that one too.
I think your answer to this will also work for that


:-)

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>

Nov 20 '05 #5
SamSpade wrote:
I have a control on a form.

Is there a way the control can receive the mouse messages that the form
would normally get?

I know the form could just call a method on the form but wonder if that is
the best way?

Thanks


I have a similiar question. I have a control (inherited from axWebBrowser) on a
form that scrolls it's contents on MouseWheel. I want it react to this event
when using the wheel anywhere on the form. How to acomplish this ?
--
Adam Nowotny
JID: da**@chrome.pl
Nov 20 '05 #6
Cor
Hi Adam,

Dzien dobry, (dwa razy kontroluje)

I have used the webbrowser intensive, but for this I do not know an answer.
I have not seen an event that matches it, but this is not the reason that I
send this message, it helps you absolutly not the reason from this message
however is to tell you never to attach a question to another messages, that
will seen as an answer.

Make always new message with a new problem.

Cor
Nov 20 '05 #7
Cor wrote:
Hi Adam,

Dzien dobry, (dwa razy kontroluje)
One would be enough this time ;-)
I have used the webbrowser intensive, but for this I do not know an answer.
I have not seen an event that matches it, but this is not the reason that I
send this message, it helps you absolutly not the reason from this message
however is to tell you never to attach a question to another messages, that
will seen as an answer.

Make always new message with a new problem.

Cor


Yes Sir ;)
Just thought it's almost the same problem and didn't want to bother people that
had this thread set to "ignore". I'll assume you're right.
Thanks for advice...i havn't used "news" for a looooooooong time...
Should move my questions to more general groups i think :)

--
Adam Nowotny
JID: da**@chrome.pl
Nov 20 '05 #8
Cor
Hi Adam,

Should move my questions to more general groups i think :)


When you want an answer on this one, I expect you only get it here, but put
it in top.

Cor
Nov 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by BadOmen | last post: by
4 posts views Thread by =?Utf-8?B?RWl0YW4=?= | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.