Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for tips on dynamically adding/deleting multiple WaveformGraph objects to/from a form.

My app will have from 3 to 32 waveforms which, for compatibility with existing UI, need to be on separate graphs for resizing and/or removal by user. I am thinking about instantiating these on a panel as needed, keeping track of spacing & sizing with an arraylist. Each graph will then carry its own labels, etc. Panel will scroll when needed to display hidden graphs. It would be nice to have a close button on each graph, but looks to me like this has to be separate from the control.
Appreciate any thoughts/experience on this type of presentation.
0 Kudos
Message 1 of 4
(4,020 Views)
Hi Pete,

You are correct that there is no way to put a close button on each graph.

One way I was able to do this was to have an ArrayList of waveformGraphs. In order to create a new control programatically, I copied the Windows Form Designer Generated code and removed the "this." before each of the calls and moved it to a button call. I then added the waveformGraph object to the array list and changed the position based on how many graphs I had inserted.

Good luck!

Allen P.
National Instruments
0 Kudos
Message 2 of 4
(4,020 Views)
Allen,

So you created a new waveformGraph object (would you call it a wrapper?) based upon the machine-generated code created by the Form Designer. Could you post some example code to illustrate its' extended use as you describe it?

Thanks.

Pete
0 Kudos
Message 3 of 4
(4,020 Views)
Here is the example I have written in C#.
0 Kudos
Message 4 of 4
(4,020 Views)