473,497 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Events Disappear

As soon as I add a UserControl to the Controls-property of my Form, the Form
does not get any MouseEvent or KeyEvent anymore. When there is no
UserControl added, the Form does get all the events.

How can I make both UserControl and Form get events?
Sep 12 '06 #1
3 3292
Hello,
About which events are you talking about? If you want to do some work
by consuming the WinForm controls placed on the user control than you
will have to raise them from with in the user control and consume the
user control events.
HTH. Cheers :)

Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
Sep 12 '06 #2
Hi,

I could bet that I read somewhere that this is by design, than when a form
has any control in it the form will not receive these events. I cannot find
it right now though :(
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Martijn Mulder" <i@mwrote in message
news:45***********************@news.wanadoo.nl...
As soon as I add a UserControl to the Controls-property of my Form, the
Form does not get any MouseEvent or KeyEvent anymore. When there is no
UserControl added, the Form does get all the events.

How can I make both UserControl and Form get events?


Sep 12 '06 #3
Martijn Mulder wrote:
As soon as I add a UserControl to the Controls-property of my Form, the Form
does not get any MouseEvent or KeyEvent anymore. When there is no
UserControl added, the Form does get all the events.

How can I make both UserControl and Form get events?
I think Ignacio is right. When the UserControl has focus, it will get
the events. If you need the form to process them first, you can handle
the Control.PreProcessMessage or Control.PreProcessControlMessage
events.

For keyboard events, you can set the KeyPreview property to true.

Sep 13 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1305
by: Rekkie | last post by:
Hi, All of our developers using C# VS.Net 2003 to develop websites are having problems with Events being deleted from their code by Visual Studio. It seems that object events defined in the...
0
1093
by: Dries | last post by:
When I put for instance a button on a UltraWebListbar (=control from infragistics), the events for the button disappear. When double-clicking on the button brings me to the Page_load in the...
1
1988
by: hybrid | last post by:
I have problems in understanding the behavior of the events triggered by dynamically created controls over a webform. Could you help me? In a webform, I have a static PlaceHolder PH containing...
3
1081
by: Good Enchiladas | last post by:
I have a class inheriting from CollectionBase that is displayed in a datagrid. When the user clicks on a button, the current record in the data grid is deleted. Unfortunately, I have to populate...
0
1439
by: StriderBob | last post by:
In a simple two form project, use a button on each form to Show() the other form and Hide() the current form. Add MouseEnter and MouseLeave events to both buttons so they change the image on each...
2
3751
by: jodyblau | last post by:
I am trying use a Calendar Control 10.0 in one of my forms. (I am using access 2002) What I want to do is have the user click a button which makes the calendar visible. Then when the user...
3
5140
by: Robert Inder | last post by:
I am struggling to catch kestrokes within an Internet Explorer 6 window. My window happens to be displaying three frames, though I suspect a similar problem would arise with a single document. ...
5
6741
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
7
1314
by: zaphod42 | last post by:
funny thing....I'm dynamically building forms, well, WAS building forms, but for this project I need some very specific validation and logic handling, so while I was changing my functions to deal...
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7160
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,...
1
6878
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
7373
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
5456
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,...
1
4897
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...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.