From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The Joy of Scrollbars

I'd like a scrollbar along the bottom of a graph, however I'd like the width
of the slider within the control to be representative of the width of the
visible graph within the entire data set. Pretty standard thing to do.

I can't find a property of the standard slider control that will allow me to
set the width of the slider itself- all I can find are functions to set the
width of the control.

I've tried the ActiveX route, however the "MS Forms Scrollbar" works only in
integers, and although it can be set so that the width of the slider is
representative of the data range, if the data range of the control is small
enough for the size variations to be visible (in my tests 0-5) then due to
the integer data you have to move the slider a considerable
distance before
the value jumps by 1; I want a smooth progression, not sudden jumping of the
graph.

I can't believe I have to write my own implementations of vertical and
horizontal scrollbars using picture controls. Does anyone have a better
solution to this? I surprised there doesn't seem a way of programmatically
changing the standard slider size- am I missing something?

--
Craig Graham
Physicist/Labview Programmer
Lancaster University, UK
0 Kudos
Message 1 of 4
(2,664 Views)
I assume you are using the Horizontal Pointer Slide and are trying to change the size of the pointer inside the slider right? This is just a decoration and does not have a property associated with it. True this would be nice to have.


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 2 of 4
(2,664 Views)
Craig,
with a lot of control editing I have succeded to have something close to what you need... It needs some more fine tuning but the VI attached shows the idea.
It is done with a slide with 3 sliders: one (transparent) to set the value and two other with fill up and fill down settings for the variable length. The fill pictures have been replaced by raised box decoration.
I hope this helps...


LabVIEW, C'est LabVIEW

0 Kudos
Message 3 of 4
(2,664 Views)
Thanks- interesting idea. I see what you mean about needing polishing- not
good when you grab the wrong part of the scrollbar and you start to resize,
rather than reposition 🙂 But that's a fairly trivial thing to watch for.

An alternative that springs to mind is a similar slide with only two
sliders, with a transparent picture control over the top to catch the mouse
events. Less efficient to draw the updates but more efficient to process
since you don't need to keep rapidly polling to make sure nothing is
happening, and to cope when the user grabs the wrong bit.

--
Craig Graham
Physicist/Labview Programmer
Lancaster University, UK


"Jean-Pierre Drolet" wrote in message
news:5065000000050000005B5B0000-1011517314000@exchange.ni.com...
> C
raig,
> with a lot of control editing I have succeded to have something close
> to what you need... It needs some more fine tuning but the VI attached
> shows the idea.
> It is done with a slide with 3 sliders: one (transparent) to set the
> value and two other with fill up and fill down settings for the
> variable length. The fill pictures have been replaced by raised box
> decoration.
> I hope this helps...
0 Kudos
Message 4 of 4
(2,664 Views)