473,219 Members | 1,649 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,219 software developers and data experts.

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 828
* " 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: BadOmen | last post by:
I want my program to send a mouse click to the window at the current mouse position, how do I do that? Example: I have my mouse over a button in Word and then my program is sending the left...
4
by: CK | last post by:
Hi all, I know this question is stupid. But i need some advice for this. I am trying to develop a website, which will allow the user send to order form to the admin email. I am planning to use the...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1...
0
by: hmm | last post by:
Hi all I have two problems: Problem #1: I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In...
12
by: info | last post by:
Hi All, I am trying to set the hourglass cursor inside a class that has nothing to do with MainForm class and I don't want to pass a reference to MainForm. How can I set the current cursor to...
0
by: neonspark | last post by:
I'm buidling some simple macro functionality for my app so the users can record a sequence of keyboard inputs and replay them reliably via some menu. Originally, I used: protected override bool...
2
by: shark | last post by:
hi, I have user control placed on form. How to make this control transparent for mouse events. I need to handle mouse events in form not in user control (like label ctrl). Thanks Shark
4
by: =?Utf-8?B?RWl0YW4=?= | last post by:
Hello, I developed a Composite Control with Visual C# (Rocker Button). The button detects MouseUp events inside the control. However I would like these MouseUp events to be transferred to the...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.