LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

canvas scroll bar help

Hello!
I am wondering if there is any way to have a scrollbar control on a canvas in CVI. The canvas should also scroll using a mouse scroll button. Something very similar to a text box control which has its own default scroll bar control.
Because the canvas control does not has its own default scroll bar, do we have to create our own scroll bar?
Thanks.
tmach
0 Kudos
Message 1 of 4
(3,637 Views)
There is a scroll bar custom control in the CVI toolslib folder that you can place next to the canvas. It's event based, so it works by notifying you whenever the user operates it. You then need to respond to these events by scrolling the contents of the canvas yourself (using the CanvasScroll function).

This control hasn't been updated in a long time, so it might not have all the functionality you need (such as responding to the mouse wheel function).

Luis
NI
0 Kudos
Message 2 of 4
(3,637 Views)
An alternative is to put the canvas on an undecorated (no title bar, no frame) child panel. Give the child panel a scrollbar, and the job is done.

--
Martin.
--
Martin
Certified CVI Developer
Message 3 of 4
(3,637 Views)
That's an excellent suggestion. A lot more straighforward than mine.

Luis
0 Kudos
Message 4 of 4
(3,637 Views)