DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

remove cursor with VBScript

I need to be able to add and remove a cursor from a 2D graph using a button on a dialog box. I figured out how to display a cursor, but I can't find a way to remove it.

 

Is there is way to use VBScript to remove a cursor from a graph?

0 Kudos
Message 1 of 5
(6,601 Views)

Hi Jo-Jo,

 

There's no property of the Cursor that lets you just hide a cursor. I'm not sure yet how you could remove cursors, but I'm looking in to it. 

 

Can you post the script you're using to add/display the cursor? 

 

K Johnson

Applications Engineer

0 Kudos
Message 2 of 5
(6,585 Views)

Hi Jo-Jo,

 

I assume you're talking about a 2D graph area in the VIEW panel, right?  In that case I'd recommend you switch the cursor mode to crosshair and then position the X,Y location of the crosshair cursor to be "off the map".  The simplest way to do that is to assign the X position to be less than the starting X value of the graph.

 

By the way, what command did you call that "Showed the cursor"?

 

Let me know if you need help with that,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 3 of 5
(6,567 Views)

I just used this:

 

View.Sheets(1).Areas("Results").DisplayObj.Area.Sheet.Cursor.Type = "Frame"

 

My workaround has been to move the curosr to line up with the outside edge of the chart, which is pretty much what you suggested.

0 Kudos
Message 4 of 5
(6,564 Views)

You could use these commands to make the cursor almost invisible. I am not so sure with -1 at the CursorWidth, but optically it looks like the thinnest cursor.

 

View.Sheets(1).Areas(1).DisplayObj.Area.Sheet.Cursor.ActiveCursorColorRGB = RGB(255,255,255) ' DEFAULT 13150860
View.Sheets(1).Areas(1).DisplayObj.Area.Sheet.Cursor.HotspotColorRGB = RGB(255,255,255) ' DEFAULT 13382400
View.Sheets(1).Areas(1).DisplayObj.Area.Sheet.Cursor.InactiveCursorColorRGB = RGB(255,255,255) ' DEFAULT 14469300
View.Sheets(1).Areas(1).DisplayObj.Area.Sheet.Cursor.CursorWidth = -1 ' DEFAULT 2

0 Kudos
Message 5 of 5
(194 Views)