Home All Groups Group Topic Archive Search About

Making a control pass events to underlying form

Author
7 Jul 2006 10:19 AM
Jerry Spence1
I have a form with a number of controls which lie on top of each other. I
had a feeling there was a control property which would allow its events to
be passed through to the parent (so that I don't have to duplicate events).
Am I right?

-Jerry

Author
7 Jul 2006 10:25 AM
Herfried K. Wagner [MVP]
"Jerry Spence1" <jerry.spe***@somewhere.com> schrieb:
>I have a form with a number of controls which lie on top of each other. I
>had a feeling there was a control property which would allow its events to
>be passed through to the parent (so that I don't have to duplicate events).


If you are referring to keyboard events, set the form's 'KeyPreview'
property to 'True'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
7 Jul 2006 2:04 PM
Jerry Spence1
Show quote Hide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:OG$rw%23aoGHA.4768@TK2MSFTNGP03.phx.gbl...
> "Jerry Spence1" <jerry.spe***@somewhere.com> schrieb:
>>I have a form with a number of controls which lie on top of each other. I
>>had a feeling there was a control property which would allow its events to
>>be passed through to the parent (so that I don't have to duplicate
>>events).
>
>
> If you are referring to keyboard events, set the form's 'KeyPreview'
> property to 'True'.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>

Thanks Herfried. I was actually hoping I could do the same with mouse
clicks. I have a picturebox inside a form, which I can move around. When I
click on the picture, I want to get the e.X and e.Y for the form, not the
picturebox. Any ideas?

-Jerry