Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get hold of the hWnd for a CWgraph control?

I wish to plot the area between two cursors on a CWGraph in inverse colour. I believe I can do this if I can get the hWnd of the control. Can I get hold of the hWnd in VB or do I have to go to VC and CW++. (I hope not 'cos I REALLY don't like MFC)

Paul Rocca
0 Kudos
Message 1 of 8
(4,365 Views)
I dont think you can get the hWnd for the control. hwever, there is an example online that uses 2 annotated cursors to indicate position on the plot.

With a little math added to this, you should be able to get the area between two cursors.

create annotations to highlight data

Hope this helps
Bilal Durrani
NI
0 Kudos
Message 2 of 8
(4,365 Views)
I'm not interested in the value of the area between the two cursors, I just wish to plot the area between the two cursors in an inverse colour (or some other method of highlighting this region of interest).

Paul
0 Kudos
Message 3 of 8
(4,365 Views)
I have attached here a screenshot of the effect we need to be able to demonstrate. Any ideas for a way of doing something like this in Measurement Studio would be much appreciated.
0 Kudos
Message 4 of 8
(4,365 Views)
Im afraid that would not be possible to do with the current controls. Hopefully we can add this feature in future versions of the controls.

But just as an idea, what if you use 2 grphs, one overlapped over the other , one plotting the data, and the other just for highlighting. You might try making the highlighting graph transparent.
just a thought.
Bilal Durrani
NI
0 Kudos
Message 6 of 8
(4,365 Views)
Managed to do it !
I used a region type annotation and set the coords for the shape to be those returned on the cursor change event.
Does just what I want 🙂
Thanks for the suggestions

Paul

PS a future suggestion might be to have a member var to set transparancency on annotations. I almost gave up
when I tried doing this, as the first shape I tried was the rectangle annotation which is not transparent, but the region annotation is transparent.
0 Kudos
Message 7 of 8
(4,365 Views)
You may not have the latest version of Measurement Studio (version 6.0), but if you do, there is a new feature of the graph called Annotations that is designed to do EXACTLY what you are wanting to do. If you don't have the latest version, it really will be worth the $395 upgrade for the time savings of this feature. http://www.ni.com/upgrade. If you do have the latest version and have questions about using the annotations, just let us know.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 5 of 8
(4,365 Views)
I got the trial version for Measurement Studio 6 because I need the annotations, but at some points in my code, the Annotations.Add function fails with run time error 70, "Can't access item" this only happens when compiled, it works fine in the VB6 environment.
I was going to buy MS 6 but if this doesn't work, I cant't use it.
0 Kudos
Message 8 of 8
(4,365 Views)