Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I'm porting an old application...

I'm interested on improving the methods used before (which are cumbersome and not good at all).

PREVIOUS NOTES:
I have a dialog based application.
On top right of that dialog I have a bitmap (CStatic that loads a resource bitmap) that must be clickable in specific places.
In the dialog OnSize handler I'm moving the controls to fit any display size.
I'm using and old class named ControlPos which handles all the movement for all the controls in the dialog based on my specifications.

QUESTION:
What I would like to do is to create a button for each position that must be clickable.
Then add this button to the ControlPos class and let it move along with the static bitmap (background).
These buttons should be invisible but should process the normal OnClick to allow me to continue processing the click events and react.

Which would be the easiest way to do that?

PS: in the old project that was solved by using an old class taken from CP CButtonST which worked really well, but it was not handling correctly the transparent effect...

Thank you in advance! :thumbsup:
Posted
Updated 18-Dec-14 21:44pm
v2

1 solution

Why not just handle mouse button events in your dialog class or the static control and perform the appropriate actions according to the position?

Then you don't need any buttons.
 
Share this answer
 
Comments
Joan M 19-Dec-14 7:17am    
Yes, that's for sure a better approach.

I truly don't know why I did not made it in that way before... I'll need a pointInsidePolygon function and some extra tweaking but it will do it...

Thanks.

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