Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create CWGraph events in VS.NET using C#?

I have created a simple form with a CWGraph object. I would like VS.NET to automatically create the Event Handler function and arguments. For example, if I double-click on the CWGraph, VS.NET automatically creates the Event Handler axCWGraph1_CursorChange() with all the correct parameters. I would like it to create the "PlotArea" handlers (PlotAreaMouseDown, PlotAreaMouseMove, etc.). Is there a simple way of doing this?

Thanks, Derek
0 Kudos
Message 1 of 4
(5,294 Views)
Derek,

Here are the steps:
1. In VS .NET open the Properties Window by going to the View menu and clicking on Properties Window.
2. In the Properties Window, select axCWGraph1 from the drop-down combo box.
3. In the Properties Window, locate the yellow lightning bolt button and click on it. This will show you all the events exposed on the CWGraph ActiveX control.
4. Locate the event that you are interested in (such as the PlotAreaMouseDown event) and move the mouse cursor over the event name.
5. Double click on the event name (such as the PlotAreaMouseDown event) with the mouse cursor and an event handler with the correct signature will be generated for you.

Hope that helps.

Abhishek Ghuwalewala
National Instruments
Abhishek Ghuwalewala | Measurement Studio | National Instruments
Message 2 of 4
(5,294 Views)
Also, you can customize the name of the event handler by typing in the
event handler name in the text box to the right of the event and then
pressing Enter. If you would like to use an existing event handler to
handle the same event on a different control, you can click the
drop-down to select an existing event handler to use.

Note this is different in VB.NET. VB.NET will not show the lightning
bolt in the Properties window. Instead, you would go to the editor,
select the control in the left drop-down at the top of the editor,
then select the event from the right-drop down.

- Elton
Message 3 of 4
(5,294 Views)
Thanks so much! I new it had to be something simple and I would slap myself on the forehead and say "Doh"!
0 Kudos
Message 4 of 4
(5,294 Views)