LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resizing a 2D Array XControl

I created an XControl that is nothing but a 2D numeric array.  I can drop the xctl onto the front panel and everything works great.  However, I can't seem to be able to manually resize the array (as in change the number of visible rows and columns, NOT Scale object with pane or Fit control to pane).
 
Does anyone know of a workaround?
 
Many thanks,

Chris_Mitchell
Product Development Engineer
Certified LabVIEW Architect

0 Kudos
Message 1 of 4
(2,492 Views)
There should be a Pane Size event you can register for in your XControl that will fire when the user resizes the XControl. Then just do a little pixel math and decide how many elements of the 2D array to be visible by setting the NumRows and NumCols properties for the 2D array on the Xcontrol FP.

Message Edited by Jarrod S. on 05-22-2007 02:31 PM

Jarrod S.
National Instruments
0 Kudos
Message 2 of 4
(2,488 Views)
Here's a very basic example in 8.2.1 (let me know if you need 8.0). It doesn't do anything smart, but it should give you an idea. If you increase the size of the XControl by any amount, it increments the number of rows and columns visible. If you shrink the XControl by any amount, it decrements the number of rows and columns visible.
Jarrod S.
National Instruments
0 Kudos
Message 3 of 4
(2,485 Views)

Many thanks, Jarrod.  You're workaround does the trick....

 


Chris_Mitchell
Product Development Engineer
Certified LabVIEW Architect

0 Kudos
Message 4 of 4
(2,473 Views)