473,406 Members | 2,404 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,406 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 831
* " 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.