LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Scrollbar system colours and visual style ?

Hi

I have created a scrollbar using the instument provided.

Is there a way of changing the scrollbar to conform to Windows Visual Style and colour ?

The panel that i created it on has both options enabled.
Help share your knowlegde
0 Kudos
Message 1 of 4
(3,995 Views)

Hi Shako,

 

What version of CVI and What OS are you using? I was able to create windows style/color scrollbars by modifying only the two options you mention in CVI 9.0 and Windows XP, so this should be all that you need to do. Please reply with an exmple showing this behavior so I can take a look.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 4
(3,957 Views)

Im using version 9.0.1 and running Xp Pro.

 

Here the code i use to create the scrollbar.

 

int ScrollBarId;

 

ScrollBarId=ScrollBar_Create (MainPnl, 48,18, 1, ScrollBarCallback, 0);

ScrollBar_SetAttribute (MainPnl,ScrollBarId, ATTR_SB_HEIGHT,(MainPnlHeight-47));
ScrollBar_SetAttribute (MainPnl, ScrollBarId, ATTR_SB_DOC_MIN,1);
ScrollBar_SetAttribute (MainPnl, ScrollBarId, ATTR_SB_PROP_THUMB,1);
ScrollBar_SetAttribute (MainPnl, ScrollBarId, ATTR_SB_VIEW_SIZE, 1);

 

I have added a picture of what the scroll bar looks like.

Help share your knowlegde
0 Kudos
Message 3 of 4
(3,945 Views)

If you look at the source code for the scrollbar function panel (C:\Program Files\National Instruments\CVI90\toolslib\custctrl\scroll.c) you will see that the scrollbar control is actually a graph control, on which the buttons and thumb control are drawn programmatically. So it won't change appearance at all when you change the visual style of the panel.

 

If you want to change the way it looks, you will have to change the source code to draw it a different way (start at the DrawScrollBar() function to see how to do that).

--
Martin
Certified CVI Developer
0 Kudos
Message 4 of 4
(3,912 Views)