Jump to content
Sign in to follow this  
Michael Aivaliotis

Alternating Row colors in Multicolumn Listbox

Recommended Posts

1.png

 

Some of you have asked how we managed to have alternating row colors in our system Multicolumn Listbox. Here is the process:

  1. Open a new blank front panel and place a classic control down. We will use this as a base to create a system control that we can use to programmaticaly change the row colors.
     
    2.png
     
    Right-click on the control and select Advanced>Customize. Press ctrl+m on your keyboard to switch to customize mode.
  2. Open a new blank front panel and place a system control down. We will use this to copy the bits we need to place into the classic control. Right-click on the system control and select Advanced>Customize. Press ctrl+m on your keyboard to switch to customize mode.
  3. You should now have two control editors open as shown.
     
    3.png
     
    Very carfully right click on the border (frame) of the system control in the control editor and select copy to clipboard. It may be easier if you move the frame to the side.
     
    4.png
     
    Now go over to the classic control and right click on the border (frame) and select import from clipboard at same size.
     
    5.png
     
    You should now have a classic control with a system frame, cool huh? One tip is that the frame may appear slightly larger than the one in the system control. just resize it a pixel or 2 smaller all the way around. Use the resize objects dialog for more accuracy.
  4. Repeat the same process, for the little square box located to the bottom right corner of the system control.
     
    5a.png
  5. The final step is to set the color for the column headers and the grid. To do this use the set color tool from the tools palette and click on the coloumn header. With the palette visible, press the A key on your keyboard. This forces the color selection to apply to the foreground and the background. Now pick the system color.
     
    6.png
  6. Now we need to implement the code that performs the row coloring.
     
    7.png

One final note. Row coloring is resource intensive so it's recommended that you use the "Defer Panel Updates" property node on the panel that will host the Multicolumn Listbox.

Share this post


Link to post
Share on other sites

Thanks for the step by step, but this isn't all you are doing to make your MultiColumn Listbox that you use in VIPM. How do you specify the color LabView icon used as the item symbol. Its not in the "listbox symbol constant" avaliable on the pallete. I had heard something about opening the VI that is used in NI's example finder, since it was a "special" MCL and if you knew the right numbers you could get these color symbols. Care to shed some light on your work here?

 

Thanks,

Chris

Share this post


Link to post
Share on other sites
Thanks for the step by step, but this isn't all you are doing to make your MultiColumn Listbox that you use in VIPM. How do you specify the color LabView icon used as the item symbol. Its not in the "listbox symbol constant" avaliable on the pallete. I had heard something about opening the VI that is used in NI's example finder, since it was a "special" MCL and if you knew the right numbers you could get these color symbols. Care to shed some light on your work here?

 

Thanks,

Chris

We are using LabVIEW 8.0 for our development of VIPM. LabVIEW 8.0 allows you to define your own glyphs to use in the first column of the MCL.

Share this post


Link to post
Share on other sites

Thanks for the walkthrough! I just have one question: When I select a Multicolumn Listbox (not system) in LabView 8.2 (Windows XP) or LabView 8.0 (Windows Vista) I get old style looking scrollbars. Not like the good looking scrollbars with the system version. In the tutorial the scrollbars look the same... Do you have any solution to the difference I am seeing?

 

Thanks,

Johan Gustafsson, Sweden

Share this post


Link to post
Share on other sites
When I select a Multicolumn Listbox (not system) in LabView 8.2 (Windows XP) or LabView 8.0 (Windows Vista) I get old style looking scrollbars. Not like the good looking scrollbars with the system version. In the tutorial the scrollbars look the same... Do you have any solution to the difference I am seeing?

I believe this is because you are selecting a modern MCL, instead of classic. See the differences below?

1.png

Share this post


Link to post
Share on other sites
Would you please explain shortly why we should change the classic MCL from modern MCL in above demonstration?

 

Because the classic version has system scrollbars, addressing the issue posed by Johan.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.