Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

region of interest cwgraph3d selection

The example provided with MS that shows how to select a region of interest is very useful to me. However, I would like to somehow show on the original plot what region is being or is currently selected, possibly with a dotted line. (Such as when you use mspaint and use the "dancing ants" box to choose what you want to move/copy/etc.

Is there a way to do this?

Thanks,
Kevin
0 Kudos
Message 1 of 2
(6,273 Views)
Hi Kevin,

The "dancing ants" box is called a "rubber-band" selection box, and that is a common Visual Basic question. One way to implement this functionality is to respond to the 3DGraph's MouseDown, MouseMove, MouseUp events to draw the rubber-band selection box onto the Visual Basic form (not on the 3DGraph itself) using the form's Line method. You can see an example of this at Microsoft's website: How to Create Rubber-Band Lines/Boxes in Visual Basic.

However - the 3DGraph is sitting on top of the Visual Basic form! The key to enabling the rubber-band selection box to be visible inside the 3DGraph as well is to set the form's AutoRedraw and ClipControls properties to
FALSE. This has to be done at design time, not at run-time. You can read more about the AutoRedraw and ClipControls properties at Microsoft's site Layering Graphics with AutoRedraw and ClipControls.

Attached is a copy of the Regions of Interest VB6 example that I have modified to implement this functionality.

David Mc.
NI Applications Engineer
Message 2 of 2
(6,273 Views)