Newbie - problem with overlapping controls and click handlers

R

Rico

Hi,

I have about a weeks worth of VB .NET experience under my belt and have run
into
something that I can't fix :-(

I have a form and it has a click event handler attached. The user clicks the
form and the handler adds a control (selected from a simple palette) to the
form at the place where they clicked. One of the controls is a box which I
sub-classed (is that the right phrase?) form a windows form control by
over-riding the paint method to draw a box with a label in the top left
corner.

When this box gets added to the form, a click handler is also added so that
the user can select it later on to change it's properties. I'm building a
bespoke UI designer here. Here is where I have a problem. If I create a box
and want to place a button on top of it the click handler for the box is
called (correctly because I clickeed the box). What I want is to call the
click handler for the Form - to add a new control to the form - instead.

Can somebody point me in the right direction please?

Can I resize the click-able portion of the box so that it is just the label
and not the entire range?
Can I force the click event to bypass the box and go to it's parent (the
Form)?

Thanks,

Richard.
 
G

G Himangi

Can I resize the click-able portion of the box so that it is just the
label
and not the entire range?
No.

Can I force the click event to bypass the box and go to it's parent (the
Form)?

No, but you can listen for the box's click event and then execute whatever
code you want to execute (like add a control to the form)

---------
- G Himangi, LogicNP Software http://www.ssware.com
Shell MegaPack: GUI Controls For Drop-In Windows Explorer like File/Folder
Browsing Functionality (.Net & ActiveX Editions).
EZNamespaceExtensions: Develop namespace extensions rapidly in .Net and
MFC/ATL/C++
EZShellExtensions: Develop all shell extensions,explorer bars and BHOs
rapidly in .Net & MFC/ATL/C++
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top