Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i do 2-dimension Led Array in Visual Studio .Net 2005?

Hello,
 
I'm using Measurement Studio 8.0.1 with Visual Studio .NET 2005
I liked the new UI control Array
but the control Led Array is 1-dimension array.
is there a way to make it 2-dimention array of Leds?
 
Thank you
 
0 Kudos
Message 1 of 3
(3,738 Views)
You cannot create a 2D array at design-time by simply changing properties of an array control. You will need to dynamically create the 2D array control in code. The following example can be inserted into the Load event of the form to create a 2D LedArray control:

            ControlArray<LedArray> twoDLedArray = new ControlArray<LedArray>();
            twoDLedArray.ScaleMode = ControlArrayScaleMode.CreateFixedMode(3);
            twoDLedArray.LayoutMode = ControlArrayLayoutMode.Horizontal;
            twoDLedArray.Border = Border.Solid;
            twoDLedArray.Location = new Point(0, 0);
            twoDLedArray.Size = new Size(208, 154);

            foreach (LedArray array in twoDLedArray)
            {
                array.ScaleMode = ControlArrayScaleMode.CreateFixedMode(3);
            }

            twoDLedArray.ItemTemplate.Height = twoDLedArray.Height - 4;

            Controls.Add(twoDLedArray);

The above code will create a 3x3 array of LedArray controls. You can size the "outer" 2D array control to your liking, but the size in code is meant to give a tight fit with the default Led and LedArray control sizes.
Abhishek Ghuwalewala | Measurement Studio | National Instruments
0 Kudos
Message 2 of 3
(3,733 Views)

Thank you.

0 Kudos
Message 3 of 3
(3,726 Views)