Graphics help
-
Hi, I'm still new to C# so please bear with me. I am trying to write a windows program, and am struggling to find info for the following things :- 1. How to get an event to trigger when the user clicks the mouse button anywhere on the window. I would like a container thats will contain grahics in the end. But when the user clicks the button I would like to get the Co-ors (X/Y) for where the user clicked. 2. I would like to show a flashing icon on the screen at particular X/Y co-ords, then when the Co-Ords have changed it will update and flash in a different place. I would like to have multiple flashes. Be able to add and remove the flashes. I am assuming I would need to create a new class for this object?? Any help or points to articles would be greatly appreciated. Regards Tony
-
Hi, I'm still new to C# so please bear with me. I am trying to write a windows program, and am struggling to find info for the following things :- 1. How to get an event to trigger when the user clicks the mouse button anywhere on the window. I would like a container thats will contain grahics in the end. But when the user clicks the button I would like to get the Co-ors (X/Y) for where the user clicked. 2. I would like to show a flashing icon on the screen at particular X/Y co-ords, then when the Co-Ords have changed it will update and flash in a different place. I would like to have multiple flashes. Be able to add and remove the flashes. I am assuming I would need to create a new class for this object?? Any help or points to articles would be greatly appreciated. Regards Tony
Nooie wrote:
But when the user clicks the button I would like to get the Co-ors (X/Y) for where the user clicked.
Look at the MouseClick event of the control, e.g. a Form or a Panel control. The e parameter contains e.X and e.Y
Nooie wrote:
2. I would like to show a flashing icon on the screen at particular X/Y co-ords
Why not drop a picture box where you want to paint the control? Or just paint directly to the control (look at the paint event) and make it flash using a timer. Many articles in this[^] section will show you how to paint to a control. Hope that's of use.
ChrisB ChrisDoesDev[^]
-
Nooie wrote:
But when the user clicks the button I would like to get the Co-ors (X/Y) for where the user clicked.
Look at the MouseClick event of the control, e.g. a Form or a Panel control. The e parameter contains e.X and e.Y
Nooie wrote:
2. I would like to show a flashing icon on the screen at particular X/Y co-ords
Why not drop a picture box where you want to paint the control? Or just paint directly to the control (look at the paint event) and make it flash using a timer. Many articles in this[^] section will show you how to paint to a control. Hope that's of use.
ChrisB ChrisDoesDev[^]