LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Moveable Column Seperators Property

Am I missing something or is there no property to control if there are "Moveable Column Seperators" on a Multicolumn Listbox?  To be clear I am not looking to programatically control the column width, I want the user to have the ability to move the columns them selves.  But I also want to be able to prevent them from being able to move the columns them selves at times.  This all stems from using an XControl that during the edit time I want to allow to be able to change the size, but during run-time the size should not be adjustable.

 

I expected to just find a property to turn that on and off (like Autosize Row Height, or Smooth Scrolling) but couldn't find it. 

0 Kudos
Message 1 of 14
(3,804 Views)

Hi Hooovahh

 

I can't see a property node to perform that function.

The closest thing I can find is to toggle the 'Column Headers Visible' node which prevents or permits the user from editing the column width by changing the UI slightly. You could also programatically set the width of the columns in a loop during the stage at which you don;t want users to be able to change the width - this should cause them to snap back to the programatically defined width when they try to change them.

 

Kind Regards

Chris | Applications Engineer NIUK
0 Kudos
Message 2 of 14
(3,791 Views)

The suggestion of hiding column headers isn't going to work in this situation.  One thing that would work, is just to add the "Moveable Column Seperators" to the run-time menu.  The problem is I don't know the tag associated with that menu option.  It is not listed here 

 

http://zone.ni.com/reference/en-XX/help/371361J-01/lvdialog/application_item_tags_scmenus/

 

What is the tag associated with this command, and will adding it have the desired affect, to allow me to right click and then allow, or don't allow moveable columns?

0 Kudos
Message 3 of 14
(3,754 Views)

You can code that behavior by filtering the "Mouse Down?" event.

MCLB_MovColHdr.png

0 Kudos
Message 4 of 14
(3,745 Views)

I must be sounding difficult at this point.  But your suggestion will also disable the ability to edit cells, and I believe even to use the scrollbars.

0 Kudos
Message 5 of 14
(3,743 Views)

It will only discard the Mouse Down event if it occurs on the headers.

0 Kudos
Message 6 of 14
(3,738 Views)

Only filtering the headers doesn't help, because you can also move the seperators from inside the table. One ugly hack which might work is to check which cursor is used inside the mouse down event and discard the event if it's the move cursor. I'm not sure if the cursor palette includes a VI for reading the current cursor or if this is something which would need to be done with the OS API.


___________________
Try to take over the world!
0 Kudos
Message 7 of 14
(3,733 Views)

This method may work.  There is no "Get Cursor" in the palette, but there was a VI posted here which gets cursor info.  Problem for me is it crashes LabVIEW, or just throws exceptions from the GetCursorInfo call.  I am in x64 so that may explain it.

0 Kudos
Message 8 of 14
(3,722 Views)
Well, I didn't look at the code itself, but based on the image, the third element seems to be a pointer, so you probably need to change it to be a pointer sized integer. It's also possible there are other API or .NET calls you can make to get the info you need, because I'm not sure that the image is what you want (although it might be all you can get). Another option you can try is using the cell size property to get the exact width of each column and use that to build a list of X positions for all the separators. Then, you use that list to discard the mouse down? event.

___________________
Try to take over the world!
0 Kudos
Message 9 of 14
(3,715 Views)

You can't move the column separators from inside the table when the VI is running, only when it is in edit mode.

0 Kudos
Message 10 of 14
(3,675 Views)