Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to set a small area of my form active on left click down of the mouse, but there is nothing there, is just an area of my background picture... and on run time may overlap some transparent pictures

I found on the tool box a control called ''border'' that it can be invisible if you set the margins to 0, and in its events has a programmable field called MouseLeftButtonDown...

below the place i want to put it there are other layers of transparent images that i dont want them to interact in any way , just to be shown and hide

Is this control suitable for the job i want it to do? or else what is the right way to set an area active on click?

What I have tried:

<border borderbrush="Black"
="" borderthickness="0" horizontalalignment="Left" height="55" margin="73,16,0,0" verticalalignment="Top" width="126" mouseleftbuttondown="Border_MouseLeftButtonDown">
Posted
Updated 15-Mar-19 5:24am
v3

1 solution

Since you are only talking "generally", and there is no real concept as an active "area", you should put your "general" mouse handler at the "form level" (starting out anyway).

That way you can track a "mouse hit" anywhere, determine the target from the "mouse event argument", and decide to "handle it" or let it "tunnel" down (by default).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900