TronListViewLibrary.TronListViewControl

TronListViewLibrary is a control based on .NET ListView in style however it is derived from UserControl and rebuilds everything. It adds new functionality, however it will require having the effieciency of the paint methods improved. Download TronListViewLibrary code. You can support the development of code by Microtron NZ at this GiveSendGo website. Select “Choose toolbox items” in Visual Studio and import the DLL that you have compiled, then place the control and write code to output a serial string to your MCU after creating a connection or control a database etc. As usual, this code is provided “as-is” under the MIT license. You can also download TronListViewLibraryTest; note that an entry will be made in your AppData folder if you run the program. You need to check that there is nothing incompatible with your computer in the programs, however the test program is really only for display purposes. See previous blurb about TronListViewControl.

TronListViewControl demo

Other controls in TronListViewLibrary

TronCheckBox (TCB) was created as part of embedded database access in a rebuilt ListView (LV) control. It has a delay that allows double click on the TCB, without changing the CheckedState. The check-boxes were written for embedded use in TronListViewControl. FormColumnNumber, FormReorder and FormTextEdit were also written as part of TronListViewControl.


//Sample code from test program above
private Bitmap DrawFilledRectangle(int x, int y, Brush brush)
        {
            Bitmap bmp = new Bitmap(x, y);
            using (Graphics graph = Graphics.FromImage(bmp))
            {
                Rectangle ImageSize = new Rectangle(0, 0, x, y);
                graph.FillRectangle(brush, ImageSize);  // Brushes.White
            }
            return bmp;
        }

private void tronListViewControl1_Load(object sender, EventArgs e)
        {
            //tronListViewControl1.ProcessEmbeddedObjectsInColumns += ProcessEmbeddedObjectsInColumns_Method;

            //comboBoxColorScheme.SelectedIndex = 0;

            //tp = new TlvpProperties(tronListViewControl1);

            Image resultImage0 = DrawFilledRectangle(20, 20, Brushes.LightGray);
            Image resultImage1 = DrawFilledRectangle(20, 20, Brushes.Brown);
            Image resultImage2 = DrawFilledRectangle(20, 20, Brushes.LightGreen);
            Image resultImage3 = DrawFilledRectangle(20, 20, Brushes.Red);
            Image resultImage4 = DrawFilledRectangle(20, 20, Brushes.Purple);

            ImageList ImageList1 = new ImageList();
            ImageList1.Images.Add(resultImage0);
            ImageList1.Images.Add(resultImage1);
            ImageList1.Images.Add(resultImage2);
            ImageList1.Images.Add(resultImage3);
            ImageList1.Images.Add(resultImage4);


            tronListViewControl1.tronImageList = ImageList1;


            tronListViewControl1.TlvColumns.Add("Test 1");
            tronListViewControl1.TlvColumns.Add("Test 2");
            tronListViewControl1.TlvColumns.Add("Test 3");
            tronListViewControl1.TlvColumns.Add("Test 4");
            tronListViewControl1.TlvColumns.Add("Test 5");
            tronListViewControl1.TlvColumns.Add("Test 6");
            tronListViewControl1.TlvColumns.Add("Test 7");
            tronListViewControl1.TlvColumns.Add("Test 8");
            tronListViewControl1.TlvColumns.Add("Test 9");
            tronListViewControl1.TlvColumns.Add("Test 10");
            tronListViewControl1.TlvColumns.Add("Test 11");
            tronListViewControl1.TlvColumns.Add("Test 12");
            tronListViewControl1.TlvColumns.Add("Test 13");

            tronListViewControl1.TlvColumns[0].Width = 50;
            tronListViewControl1.TlvColumns[1].Width = 50;
            tronListViewControl1.TlvColumns[2].Width = 50;
            tronListViewControl1.TlvColumns[3].Width = 50;
            tronListViewControl1.TlvColumns[4].Width = 50;
            tronListViewControl1.TlvColumns[5].Width = 50;
            tronListViewControl1.TlvColumns[6].Width = 80;
            tronListViewControl1.TlvColumns[7].Width = 80;
            tronListViewControl1.TlvColumns[8].Width = 80;
            tronListViewControl1.TlvColumns[9].Width = 80;
            tronListViewControl1.TlvColumns[10].Width = 80;
            tronListViewControl1.TlvColumns[11].Width = 50;
            tronListViewControl1.TlvColumns[12].Width = 50;


            string[] entry = new string[13];  //

            entry[0] = "Aaron";
            entry[1] = "Irulan";
            entry[2] = "Harry";
            entry[3] = "True";
            entry[4] = "Tom";
            entry[5] = "Ben";
            entry[6] = "Alice";
            entry[7] = "Daniel";
            entry[8] = "Ralph";
            entry[9] = "Anne";
            entry[10] = "Candy";
            entry[11] = "Sandy";
            entry[12] = "Irulan";

            // ListViewItem lvi = new ListViewItem(entry);

            // tronListViewControl1.TlvItems.Add(lvi);


            TLVCItem lvi = new TLVCItem(entry, tronListViewControl1);
            //lvi.SubItems[2].BackColor = Color.LightGray;
            tronListViewControl1.TlvItems.Add(lvi);


            string[] entry2 = new string[13];

            entry2[0] = "Charles";
            entry2[1] = "6";
            entry2[2] = "Harriet";
            entry2[3] = "False";
            entry2[4] = "Hannah";
            entry2[5] = "Carter";
            entry2[6] = "Dana";
            entry2[7] = "Nick";
            entry2[8] = "Tony";
            entry2[9] = "Natalie";
            entry2[10] = "Candyo";
            entry2[11] = "Sandyo";
            entry2[12] = "6";

            // ListViewItem lvi2 = new ListViewItem(entry2);

            // tronListViewControl1.TlvItems.Add(lvi2);

            TLVCItem lv2 = new TLVCItem(entry2, tronListViewControl1);

            tronListViewControl1.TlvItems.Add(lv2);







            string[] entry3 = new string[13];  //




            entry3[0] = "Title 0";
            entry3[1] = "8";
            entry3[2] = "Title 2";
            entry3[3] = "True";
            entry3[4] = "Title 4";
            entry3[5] = "Title 5";
            entry3[6] = "Title 6";
            entry3[7] = "Title 7";
            entry3[8] = "Title 8";
            entry3[9] = "Title 9";
            entry3[10] = "Title 10";
            entry3[11] = "Title 11";
            entry3[12] = "8";

            TLVCItem lvi3 = new TLVCItem(entry3, tronListViewControl1);

            tronListViewControl1.TlvItems.Add(lvi3);




            entry3[0] = "Harper";
            entry3[1] = "5";
            entry3[2] = "Cindy";
            entry3[3] = "True";
            entry3[4] = "Kim";
            entry3[5] = "Jordan";
            entry3[6] = "Cameron";
            entry3[7] = "Homer";
            entry3[8] = "Dianne";
            entry3[9] = "Bill";
            entry3[10] = "CandyO";
            entry3[11] = "SandyO";
            entry3[12] = "5";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);

            tronListViewControl1.TlvItems.Add(lvi3);


            entry3[0] = "Harp";
            entry3[1] = "7";
            entry3[2] = "Cinder";
            entry3[3] = "False";
            entry3[4] = "Kimmy";
            entry3[5] = "Jordana";
            entry3[6] = "Camerona";
            entry3[7] = "Homeradilla";
            entry3[8] = "Dianna";
            entry3[9] = "Billy";
            entry3[10] = "Candida";
            entry3[11] = "Sandida";
            entry3[12] = "7";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            lvi3.LineHeight = 35;
            tronListViewControl1.TlvItems.Add(lvi3);






            entry3[0] = "Sue";
            entry3[1] = "9";
            entry3[2] = "Megan";
            entry3[3] = "False";
            entry3[4] = "Mik";
            entry3[5] = "Jorda";
            entry3[6] = "Camero";
            entry3[7] = "Homernym";
            entry3[8] = "Diannabell";
            entry3[9] = "Billious";
            entry3[10] = "Candizy";
            entry3[11] = "Sandizy";
            entry3[12] = "9";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);

            tronListViewControl1.TlvItems.Add(lvi3);

            entry3[0] = "Suey";
            entry3[1] = "10";
            entry3[2] = "Megany";
            entry3[3] = "False";
            entry3[4] = "Miky";
            entry3[5] = "Jorday";
            entry3[6] = "Cameroy";
            entry3[7] = "Homernymy";
            entry3[8] = "Diannabelly";
            entry3[9] = "Billiousy";
            entry3[10] = "CandizyO";
            entry3[11] = "SandizyO";
            entry3[12] = "10";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            lvi3.GridGapBottomHorz = 8;
            lvi3.GridLineBottomHorzThickness = 8;
            lvi3.GridLineVertThickness = tronListViewControl1.GridGapVertical;
            tronListViewControl1.TlvItems.Add(lvi3);


            entry3[0] = "Suee";
            entry3[1] = "11";
            entry3[2] = "Megane";
            entry3[3] = "False";
            entry3[4] = "Mike";
            entry3[5] = "Jordae";
            entry3[6] = "Cameroe";
            entry3[7] = "Homernyme";
            entry3[8] = "Diannabelle";
            entry3[9] = "Billiouse";
            entry3[10] = "Canny";
            entry3[11] = "Sanny";
            entry3[12] = "11";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            lvi3.GridLineBottomHorzNotVisible = true;
            tronListViewControl1.TlvItems.Add(lvi3);


            entry3[0] = "Sueo";
            entry3[1] = "12";
            entry3[2] = "Megano";
            entry3[3] = "False";
            entry3[4] = "Miko";
            entry3[5] = "Jordao";
            entry3[6] = "Cameroo";
            entry3[7] = "Homernymo";
            entry3[8] = "Diannabello";
            entry3[9] = "Billiouso";
            entry3[10] = "CannyO";
            entry3[11] = "SannyO";
            entry3[12] = "12";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);

            tronListViewControl1.TlvItems.Add(lvi3);


            entry3[0] = "Suey";
            entry3[1] = "13";
            entry3[2] = "Megany";
            entry3[3] = "False";
            entry3[4] = "Miky";
            entry3[5] = "Jorday";
            entry3[6] = "Cameroy";
            entry3[7] = "Homernymy";
            entry3[8] = "Diannabelly";
            entry3[9] = "Billiousy";
            entry3[10] = "CandizyO";
            entry3[11] = "SandizyO";
            entry3[12] = "13";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            lvi3.GridLineVertNotVisible = true;
            tronListViewControl1.TlvItems.Add(lvi3);


            entry3[0] = "Title 0";
            entry3[1] = "8";
            entry3[2] = "Title 2";
            entry3[3] = "True";
            entry3[4] = "Title 4";
            entry3[5] = "Title 5";
            entry3[6] = "Title 6";
            entry3[7] = "Title 7";
            entry3[8] = "Title 8";
            entry3[9] = "Title 9";
            entry3[10] = "Title 10";
            entry3[11] = "Title 11";
            entry3[12] = "8";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            lvi3.ColorGridLinesVert = Color.Aqua;
            lvi3.ColorGridLineBottomHorz = Color.Red;

            tronListViewControl1.TlvItems.Add(lvi3);

            entry3[0] = "Suee";
            entry3[1] = "14";
            entry3[2] = "Megane";
            entry3[3] = "False";
            entry3[4] = "Mike";
            entry3[5] = "Jordae";
            entry3[6] = "Cameroe";
            entry3[7] = "Homernyme";
            entry3[8] = "Diannabelle";
            entry3[9] = "Billiouse";
            entry3[10] = "Canny";
            entry3[11] = "Sanny";
            entry3[12] = "14";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            lvi3.HeaderLineFormat = true;
            tronListViewControl1.TlvItems.Add(lvi3);


            entry3[0] = "Sueo";
            entry3[1] = "15";
            entry3[2] = "Megano";
            entry3[3] = "False";
            entry3[4] = "Miko";
            entry3[5] = "Jordao";
            entry3[6] = "Cameroo";
            entry3[7] = "Homernymo";
            entry3[8] = "Diannabello";
            entry3[9] = "Billiouso";
            entry3[10] = "CannyO";
            entry3[11] = "SannyO";
            entry3[12] = "15";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);

            tronListViewControl1.TlvItems.Add(lvi3);

            string[] entry4 = new string[4];

            entry4[0] = "Suee";
            entry4[1] = "14";
            entry4[2] = "Megane";
            entry4[3] = "20";

            lvi3 = new TLVCItem(entry4, tronListViewControl1);

            lvi3.SubItems[0].AdlibRelX = 40;
            lvi3.SubItems[0].AdlibRelY = 20;
            lvi3.SubItems[0].AdlibWidth = 60;
            lvi3.SubItems[0].AdlibHeight = 30;

            lvi3.SubItems[1].AdlibRelX = 40;
            lvi3.SubItems[1].AdlibRelY = 90;
            lvi3.SubItems[1].AdlibWidth = 160;
            lvi3.SubItems[1].AdlibHeight = 140;

            lvi3.SubItems[2].AdlibRelX = 220;
            lvi3.SubItems[2].AdlibRelY = 20;
            lvi3.SubItems[2].AdlibWidth = 160;
            lvi3.SubItems[2].AdlibHeight = 50;

            lvi3.SubItems[3].AdlibRelX = 220;
            lvi3.SubItems[3].AdlibRelY = 90;
            lvi3.SubItems[3].AdlibWidth = 160;
            lvi3.SubItems[3].AdlibHeight = 140;

            lvi3.LineHeight = 260;

            tronListViewControl1.TlvItems.Add(lvi3);

            //int countmin1 = tronListViewControl1.TlvItems.Count - 1;
            //MessageBox.Show("adlibheight " + tronListViewControl1.TlvItems[countmin1].SubItems[3].AdlibHeight);
            //MessageBox.Show("countmin1 " + countmin1);


            entry3[0] = "Suee";
            entry3[1] = "14";
            entry3[2] = "Megane";
            entry3[3] = "False";
            entry3[4] = "Mike";
            entry3[5] = "Jordae";
            entry3[6] = "Cameroe";
            entry3[7] = "Homernyme";
            entry3[8] = "Diannabelle";
            entry3[9] = "Billiouse";
            entry3[10] = "Canny";
            entry3[11] = "Sanny";
            entry3[12] = "14";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            //lvi3.HeaderLineFormat = true;
            tronListViewControl1.TlvItems.Add(lvi3);


            entry3[0] = "Sueo";
            entry3[1] = "15";
            entry3[2] = "Megano";
            entry3[3] = "False";
            entry3[4] = "Miko";
            entry3[5] = "Jordao";
            entry3[6] = "Cameroo";
            entry3[7] = "Homernymo";
            entry3[8] = "Diannabello";
            entry3[9] = "Billiouso";
            entry3[10] = "CannyO";
            entry3[11] = "SannyO";
            entry3[12] = "15";

            lvi3 = new TLVCItem(entry3, tronListViewControl1);

            tronListViewControl1.TlvItems.Add(lvi3);




            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry3, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);
            lvi3 = new TLVCItem(entry2, tronListViewControl1);
            tronListViewControl1.TlvItems.Add(lvi3);


            string[] entry5 = new string[6];

            entry5[0] = "Suee";
            entry5[1] = "14";
            entry5[2] = "Megane";
            entry5[3] = "20";
            entry5[4] = "Suey";
            entry5[5] = "18";
            //entry4[6] = "Megany";
            //entry4[7] = "20";

            lvi3 = new TLVCItem(entry5, tronListViewControl1);

            lvi3.SubItems[0].AdlibRelX = 40;
            lvi3.SubItems[0].AdlibRelY = 20;
            lvi3.SubItems[0].AdlibWidth = 60;
            lvi3.SubItems[0].AdlibHeight = 30;

            lvi3.SubItems[1].AdlibRelX = 40;
            lvi3.SubItems[1].AdlibRelY = 90;
            lvi3.SubItems[1].AdlibWidth = 160;
            lvi3.SubItems[1].AdlibHeight = 140;

            lvi3.SubItems[2].AdlibRelX = 220;
            lvi3.SubItems[2].AdlibRelY = 20;
            lvi3.SubItems[2].AdlibWidth = 160;
            lvi3.SubItems[2].AdlibHeight = 50;

            lvi3.SubItems[3].AdlibRelX = 220;
            lvi3.SubItems[3].AdlibRelY = 90;
            lvi3.SubItems[3].AdlibWidth = 160;
            lvi3.SubItems[3].AdlibHeight = 140;

            lvi3.SubItems[4].AdlibRelX = 400;
            lvi3.SubItems[4].AdlibRelY = 20;
            lvi3.SubItems[4].AdlibWidth = 160;
            lvi3.SubItems[4].AdlibHeight = 50;

            lvi3.SubItems[5].AdlibRelX = 400;
            lvi3.SubItems[5].AdlibRelY = 90;
            lvi3.SubItems[5].AdlibWidth = 120;
            lvi3.SubItems[5].AdlibHeight = 120;


            lvi3.LineHeight = 260;

            tronListViewControl1.TlvItems.Add(lvi3);


            lvi3 = new TLVCItem(entry5, tronListViewControl1);

            lvi3.SubItems[0].AdlibRelX = 40;
            lvi3.SubItems[0].AdlibRelY = 20;
            lvi3.SubItems[0].AdlibWidth = 60;
            lvi3.SubItems[0].AdlibHeight = 30;

            lvi3.SubItems[1].AdlibRelX = 40;
            lvi3.SubItems[1].AdlibRelY = 90;
            lvi3.SubItems[1].AdlibWidth = 160;
            lvi3.SubItems[1].AdlibHeight = 140;

            lvi3.SubItems[2].AdlibRelX = 220;
            lvi3.SubItems[2].AdlibRelY = 20;
            lvi3.SubItems[2].AdlibWidth = 160;
            lvi3.SubItems[2].AdlibHeight = 50;

            lvi3.SubItems[3].AdlibRelX = 220;
            lvi3.SubItems[3].AdlibRelY = 90;
            lvi3.SubItems[3].AdlibWidth = 160;
            lvi3.SubItems[3].AdlibHeight = 140;

            lvi3.SubItems[4].AdlibRelX = 400;
            lvi3.SubItems[4].AdlibRelY = 20;
            lvi3.SubItems[4].AdlibWidth = 160;
            lvi3.SubItems[4].AdlibHeight = 50;

            lvi3.SubItems[5].AdlibRelX = 400;
            lvi3.SubItems[5].AdlibRelY = 90;
            lvi3.SubItems[5].AdlibWidth = 120;
            lvi3.SubItems[5].AdlibHeight = 120;


            lvi3.LineHeight = 260;

            tronListViewControl1.TlvItems.Add(lvi3);



            lvi3 = new TLVCItem(entry5, tronListViewControl1);

            lvi3.SubItems[0].AdlibRelX = 40;
            lvi3.SubItems[0].AdlibRelY = 20;
            lvi3.SubItems[0].AdlibWidth = 60;
            lvi3.SubItems[0].AdlibHeight = 30;

            lvi3.SubItems[1].AdlibRelX = 40;
            lvi3.SubItems[1].AdlibRelY = 90;
            lvi3.SubItems[1].AdlibWidth = 160;
            lvi3.SubItems[1].AdlibHeight = 140;

            lvi3.SubItems[2].AdlibRelX = 220;
            lvi3.SubItems[2].AdlibRelY = 20;
            lvi3.SubItems[2].AdlibWidth = 160;
            lvi3.SubItems[2].AdlibHeight = 50;

            lvi3.SubItems[3].AdlibRelX = 220;
            lvi3.SubItems[3].AdlibRelY = 90;
            lvi3.SubItems[3].AdlibWidth = 160;
            lvi3.SubItems[3].AdlibHeight = 140;

            lvi3.SubItems[4].AdlibRelX = 400;
            lvi3.SubItems[4].AdlibRelY = 20;
            lvi3.SubItems[4].AdlibWidth = 160;
            lvi3.SubItems[4].AdlibHeight = 50;

            lvi3.SubItems[5].AdlibRelX = 400;
            lvi3.SubItems[5].AdlibRelY = 90;
            lvi3.SubItems[5].AdlibWidth = 120;
            lvi3.SubItems[5].AdlibHeight = 100;


            lvi3.LineHeight = 260;

            tronListViewControl1.TlvItems.Add(lvi3);


            lvi3 = new TLVCItem(entry5, tronListViewControl1);

            lvi3.SubItems[0].AdlibRelX = 40;
            lvi3.SubItems[0].AdlibRelY = 20;
            lvi3.SubItems[0].AdlibWidth = 60;
            lvi3.SubItems[0].AdlibHeight = 30;

            lvi3.SubItems[1].AdlibRelX = 40;
            lvi3.SubItems[1].AdlibRelY = 90;
            lvi3.SubItems[1].AdlibWidth = 160;
            lvi3.SubItems[1].AdlibHeight = 140;

            lvi3.SubItems[2].AdlibRelX = 220;
            lvi3.SubItems[2].AdlibRelY = 20;
            lvi3.SubItems[2].AdlibWidth = 160;
            lvi3.SubItems[2].AdlibHeight = 50;

            lvi3.SubItems[3].AdlibRelX = 220;
            lvi3.SubItems[3].AdlibRelY = 90;
            lvi3.SubItems[3].AdlibWidth = 160;
            lvi3.SubItems[3].AdlibHeight = 140;

            lvi3.SubItems[4].AdlibRelX = 400;
            lvi3.SubItems[4].AdlibRelY = 20;
            lvi3.SubItems[4].AdlibWidth = 160;
            lvi3.SubItems[4].AdlibHeight = 50;

            lvi3.SubItems[5].AdlibRelX = 400;
            lvi3.SubItems[5].AdlibRelY = 90;
            lvi3.SubItems[5].AdlibWidth = 120;
            lvi3.SubItems[5].AdlibHeight = 100;


            lvi3.LineHeight = 260;

            tronListViewControl1.TlvItems.Add(lvi3);


            tronListViewControl1.TlvItems[0].SubItems[0].ImageIndex = 0;
            tronListViewControl1.TlvItems[1].SubItems[0].ImageIndex = 1;
            tronListViewControl1.TlvItems[2].SubItems[0].ImageIndex = 2;
            tronListViewControl1.TlvItems[3].SubItems[0].ImageIndex = 3;
            tronListViewControl1.TlvItems[4].SubItems[0].ImageIndex = 4;

            tronListViewControl1.TlvItems[11].SubItems[0].CanSelectCell = false;
            tronListViewControl1.TlvItems[12].SubItems[0].CanSelectRow = false;

            //tronListViewControl1.TlvItems[0].SubItems[2].BackColor = Color.LightGray;

            //MessageBox.Show("Index " + tronListViewControl1.TlvItems[1].Index);

            //MessageBox.Show("count " + tronListViewControl1.TlvItems.Count + "  subitems " + tronListViewControl1.TlvItems[0].SubItems.Count);
            tronListViewControl1.TlvItems[13].SubItems[2].Text = "25";
            //TrackBarItem13_ValueChanged(null, null);
        }

        private ITronCustomControl tronListViewControl1_ProcessEmbeddedObjectsInColumns(object sender, SIEventArgs args)
        {
            if (args.Item.Index == 2 || args.Item.Index == 10)
            {
                return null;
            }
            else if (args.Item.Index < 9)
            {
                if (args.subItemIndex == 1)
                {
                    ITronCustomControl nud = new NumericUpDownEmbeddedControl();
                    return nud;
                }

                if (args.subItemIndex == 2)
                {
                    ITronCustomControl nud = new TextBoxEmbeddedControl() { BackColor = SystemColors.ControlLight }; // Color.LightGray }; 
                    return nud;
                }


                if (args.subItemIndex == 3)
                {
                    ITronCustomControl nud = new CheckBoxEmbeddedControl(); // { BackColor = Color.LightGray };

                    return nud;
                }

                if (args.subItemIndex == 5)
                {
                    ITronCustomControl nud = new TextCellEditorEmbeddedControl();



                    return nud;
                }


                if (args.subItemIndex == 6)
                {

                    ITronCustomControl nud = new TronCheckBoxEmbeddedControl()
                    { EmbeddedControl = true, CheckedChangedOnFocusClick = true, NoDoubleClickNorDelay = true };

                    return nud;
                }

                if (args.subItemIndex == 7)
                {
                    ITronCustomControl nud = new DateTimePickerClickEmbeddedControl();
                    return nud;
                }


                if (args.subItemIndex == 8)
                {
                    ITronCustomControl nud = new CheckBoxClickEmbeddedControl();
                    return nud;
                }

                if (args.subItemIndex == 9)
                {
                    ITronCustomControl nud = new ComboBoxClickEmbeddedControl();
                    if (nud is ITronClickControl itcc)
                    {
                        //ComboBox cb = (ComboBox)itcc.clickcontrol;
                        if (itcc.clickcontrol is ComboBox cb)
                        {
                            cb.DropDownStyle = ComboBoxStyle.DropDownList;
                            cb.Items.Add("Orange");
                            cb.Items.Add("Red");
                            cb.Items.Add("Green");
                            cb.Items.Add("Purple");
                            cb.Items.Add("Beige");
                        }
                    }
                    return nud;
                }
                if (args.subItemIndex == 10)
                {
                    ITronCustomControl nud = new TextBoxClickEmbeddedControl();
                    return nud;
                }

                if (args.subItemIndex == 12)
                {
                    ITronCustomControl nud = new NumericUpDownEmbeddedControl()
                    {
                        ConditionalAcceptance = true
                    };
                    return nud;
                }
            }

            else if (args.Item.Index == 13)
            {
                if (args.subItemIndex == 1)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl() { Maximum = 100, Minimum = 0, MajorTick = 20, MinorTick = 10, ClockfaceDisplay = true, LabelText = "M/s", ShowLabel = true,
                        TitleLabelText = "Velocity", ShowTitleLabel = true, LogarithmicScale = true, MajorLogTick = 2, MinorLogTickCountPerInterval = 1, LogMinimum = 1, LogMaximum = 128,
                    }; // MajorLogTick = 10, MinorLogTickCountPerInterval = 1, LogMinimum = 10, LogMaximum = 1000,



                    return nud;
                }
                if (args.subItemIndex == 2)
                {
                    ITronCustomControl nud = new SliderEmbeddedControl() { Maximum = 110, Minimum = -20 };

                    if (nud is SliderEmbeddedControl sec)
                        sec.ValueChanged += TrackBarItem13_ValueChanged;

                    return nud;
                }
                if (args.subItemIndex == 3)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl() { Maximum = 100, Minimum = 0, MajorTick = 20, MinorTick = 10, LabelText = "Km/h", ShowLabel = true, ShowTitleLabel = true,
                        TitleLabelText = "Speed",
                        //LogarithmicScale = true,
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        ClockfaceDisplay = true,
                    };



                    return nud;
                }
            }
            else if(args.Item.Index < 62)
            {
                if (args.subItemIndex == 2)
                {
                    ITronCustomControl nud = new TextCellEditorEmbeddedControl();



                    return nud;
                }

                if (args.subItemIndex == 3)
                {
                    ITronCustomControl nud = new NumericUpDownEmbeddedControl()
                    {
                        ConditionalAcceptance = true
                    };
                    return nud;
                }
                if (args.subItemIndex == 4)
                {
                    ITronCustomControl nud = new TextBoxEmbeddedControl();
                    return nud;
                }


                if (args.subItemIndex == 5)
                {
                    ITronCustomControl nud = new CheckBoxEmbeddedControl();

                    return nud;
                }
                if (args.subItemIndex == 6)
                {
                    ITronCustomControl nud = new NumericUpDownEmbeddedControl();
                    return nud;
                }

                if (args.subItemIndex == 7)
                {
                    ITronCustomControl nud = new ComboBoxClickEmbeddedControl();
                    if (nud is ITronClickControl itcc)
                    {
                        //ComboBox cb = (ComboBox)itcc.clickcontrol;
                        if (itcc.clickcontrol is ComboBox cb)
                        {
                            cb.DropDownStyle = ComboBoxStyle.DropDownList;
                            cb.Items.Add("Orange");
                            cb.Items.Add("Red");
                            cb.Items.Add("Green");
                            cb.Items.Add("Purple");
                            cb.Items.Add("Beige");
                        }
                    }
                    return nud;
                }

                if (args.subItemIndex == 8)
                {
                    ITronCustomControl nud = new CheckBoxClickEmbeddedControl();
                    return nud;
                }
                if (args.subItemIndex == 11)
                {

                    ITronCustomControl nud = new TronCheckBoxEmbeddedControl()
                    {  EmbeddedControl = true };

                    return nud;
                }

                if (args.subItemIndex == 12)
                {
                    ITronCustomControl nud = new DateTimePickerClickEmbeddedControl();
                    return nud;
                }






            }
            else if (args.Item.Index == 62)
            {
                if (args.subItemIndex == 1)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        ClockfaceDisplay = true,
                        //ShowTextBox = true,
                        LabelText = "M/s",
                        ShowLabel = true,
                        TitleLabelText = "Velocity",
                        ShowTitleLabel = true,
                        LogarithmicScale = true,
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        MinorTickValues = true,
                    }; // MajorLogTick = 10, MinorLogTickCountPerInterval = 1, LogMinimum = 10, LogMaximum = 1000,



                    return nud;
                }
                if (args.subItemIndex == 2)
                {
                    ITronCustomControl nud = new SliderEmbeddedControl() { Maximum = 110, Minimum = -20 };

                    if (nud is SliderEmbeddedControl sec)
                        sec.ValueChanged += TrackBarItem62_ValueChanged;

                    return nud;
                }
                if (args.subItemIndex == 3)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        LabelText = "Km/h",
                        //ShowTextBox = true,
                        ShowLabel = true,
                        ShowTitleLabel = true,
                        TitleLabelText = "Speed",
                        //LogarithmicScale = true,
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        ClockfaceDisplay = true,
                        ShowTextBox = SpeedoEmbeddedControl.TextBoxMode.label,
                        YAdjTextBoxLabel = 7,
                        YAdjLabel = 10,
                        TextBoxLabelColor = Color.Red,
                        TitleLabelFontSize = 8.0f,
                        LabelFontSize = 7.5f,
                        MinorTickValues = true,
                    };



                    return nud;
                }
                if (args.subItemIndex == 5)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        LabelText = "Km/h",
                        //ShowTextBox = true,
                        ShowLabel = true,
                        ShowTitleLabel = true,
                        TitleLabelText = "Speed",
                        //LogarithmicScale = true,
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        ClockfaceDisplay = true,
                        YAdjLabel = 15,
                        ShowTextBox = SpeedoEmbeddedControl.TextBoxMode.label,
                        LabelFontSize = 7.5f,
                        YAdjTextBoxLabel = 0,
                        TextBoxLabelColor = Color.Blue,
                        TitleLabelFontSize = 7.5f,
                        MinorTickValues = true,
                        //ShowOuterRing = true,
                    };



                    return nud;
                }
            }


            else if (args.Item.Index == 63)
            {
                if (args.subItemIndex == 1)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        ClockfaceDisplay = true,
                        //ShowTextBox = true,
                        LabelText = "M/s",
                        ShowLabel = true,
                        TitleLabelText = "Velocity",
                        ShowTitleLabel = true,
                        //LogarithmicScale = true,
                        MajorLogTick = 10,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 1000,
                        MinorTickValues = true,
                    }; // MajorLogTick = 10, MinorLogTickCountPerInterval = 1, LogMinimum = 10, LogMaximum = 1000,



                    return nud;
                }
                if (args.subItemIndex == 2)
                {
                    ITronCustomControl nud = new SliderEmbeddedControl() { Maximum = 110, Minimum = -20 };

                    if (nud is SliderEmbeddedControl sec)
                        sec.ValueChanged += TrackBarItem63_ValueChanged;

                    return nud;
                }
                if (args.subItemIndex == 3)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        LabelText = "Km/h",
                        //ShowTextBox = true,
                        ShowLabel = true,
                        ShowTitleLabel = true,
                        TitleLabelText = "Speed",                        
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        MinorTickValues = true,
                        //ClockfaceDisplay = true,
                    };



                    return nud;
                }
                if (args.subItemIndex == 5)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        LabelText = "Km/h",
                        //ShowTextBox = true,
                        ShowLabel = true,
                        ShowTitleLabel = true,
                        TitleLabelText = "Speed",
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        TitleLabelFontSize = 7.5f,
                        LabelFontSize = 7.5f,
                        ShowTextBox = SpeedoEmbeddedControl.TextBoxMode.label,
                        YAdjTextBoxLabel = 20,
                        TextBoxLabelColor = Color.Blue,
                        //ClockfaceDisplay = true,
                    };



                    return nud;
                }
            }


            else if (args.Item.Index == 64)
            {
                if (args.subItemIndex == 1)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 20,
                        MajorTick = 20,
                        MinorTick = 10,
                        ClockfaceDisplay = true,
                        //ShowTextBox = true,
                        LabelText = "M/s",
                        ShowLabel = true,
                        TitleLabelText = "Velocity",
                        ShowTitleLabel = true,
                        LogarithmicScale = true,
                        MajorLogTick = 3,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 243,
                        MinorTickValues = true,
                    }; // MajorLogTick = 10, MinorLogTickCountPerInterval = 1, LogMinimum = 10, LogMaximum = 1000,



                    return nud;
                }
                if (args.subItemIndex == 2)
                {
                    ITronCustomControl nud = new SliderEmbeddedControl() { Maximum = 110, Minimum = -20 };

                    if (nud is SliderEmbeddedControl sec)
                        sec.ValueChanged += TrackBarItem64_ValueChanged;

                    return nud;
                }
                if (args.subItemIndex == 3)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        LabelText = "Km/h",
                        //ShowTextBox = true,
                        ShowLabel = true,
                        ShowTitleLabel = true,
                        TitleLabelText = "Speed",
                        //LogarithmicScale = true,
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        //HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        ClockfaceDisplay = true,
                        MinorTickValues = true,
                    };



                    return nud;
                }
                if (args.subItemIndex == 5)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        LabelText = "Km/h",
                        //ShowTextBox = true,
                        ShowLabel = true,
                        ShowTitleLabel = true,
                        TitleLabelText = "Speed",
                        //LogarithmicScale = true,
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        //HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        ClockfaceDisplay = true,
                        YAdjLabel = 5,
                        ShowTextBox = SpeedoEmbeddedControl.TextBoxMode.label,
                        TitleLabelFontSize = 7.5f,
                        YAdjTitleLabel = 7,
                        YAdjTextBoxLabel = 32,
                        LabelFontSize = 7.5f,
                        TextBoxLabelFontSize = 7.5f,
                        TextBoxLabelColor = Color.Blue,
                        MinorTickValues = true,
                    };



                    return nud;
                }
            }


            else if (args.Item.Index == 65)
            {
                if (args.subItemIndex == 1)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        //ClockfaceDisplay = true,
                        //ShowTextBox = true,
                        LabelText = "M/s",
                        ShowLabel = true,
                        TitleLabelText = "Velocity",
                        ShowTitleLabel = true,
                        LogarithmicScale = true,
                        MajorLogTick = 10,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 1000,
                        ShowRing = true,
                        ShowOuterRing = true,
                        MinorTickValues = true,
                    }; // MajorLogTick = 10, MinorLogTickCountPerInterval = 1, LogMinimum = 10, LogMaximum = 1000,



                    return nud;
                }
                else if (args.subItemIndex == 2)
                {
                    ITronCustomControl nud = new SliderEmbeddedControl() { Maximum = 110, Minimum = -20 };

                    if (nud is SliderEmbeddedControl sec)
                        sec.ValueChanged += TrackBarItem65_ValueChanged;

                    return nud;
                }
                else if (args.subItemIndex == 3)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        LabelText = "Km/h",
                        //ShowTextBox = true,
                        ShowLabel = true,
                        ShowTitleLabel = true,
                        TitleLabelText = "Speed",
                        //LogarithmicScale = true,
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        //HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        MinorTickValues = true,

                        //ClockfaceDisplay = true,
                    };



                    return nud;
                }
                else if (args.subItemIndex == 5)
                {
                    ITronCustomControl nud = new SpeedoEmbeddedControl()
                    {
                        Maximum = 100,
                        Minimum = 0,
                        MajorTick = 20,
                        MinorTick = 10,
                        LabelText = "Km/h",
                        //ShowTextBox = false,
                        ShowLabel = true,
                        ShowTitleLabel = true,
                        TitleLabelText = "Speed",
                        //LogarithmicScale = true,
                        MajorLogTick = 2,
                        MinorLogTickCountPerInterval = 1,
                        LogMinimum = 1,
                        LogMaximum = 128,
                        //HalfMoonDisplay = true,
                        ShowRing = true,
                        ShowOuterRing = true,
                        OverScaleStep = true,
                        YAdjTitleLabel = 15,
                        TitleLabelFontSize = 8.0f,
                        LabelFontSize = 6.0f,
                        ShowTextBox = SpeedoEmbeddedControl.TextBoxMode.label,
                        YAdjLabel = 8,
                        YAdjTextBoxLabel = 4,
                        TextBoxLabelFontSize = 7.5f,
                        OuterRingColor = Color.Blue,


                        //ClockfaceDisplay = true,
                    };



                    return nud;
                }
            }




            return null;
        }


        private void TrackBarItem13_ValueChanged(object sender, System.EventArgs e)
        {
            if (sender is TrackBar tb)
            {
                //EmbeddedObject eo = tronListViewControl1.TlvItems[13].SubItems[3].EO;
                //if(eo != null)
                //    eo.control.Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[13].SubItems[1].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[13].SubItems[3].Text = tb.Value.ToString();
            }
        }

        private void TrackBarItem62_ValueChanged(object sender, System.EventArgs e)
        {
            if (sender is TrackBar tb)
            {              
                tronListViewControl1.TlvItems[62].SubItems[1].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[62].SubItems[3].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[62].SubItems[5].Text = tb.Value.ToString();
            }
        }

        private void TrackBarItem63_ValueChanged(object sender, System.EventArgs e)
        {
            if (sender is TrackBar tb)
            {
                tronListViewControl1.TlvItems[63].SubItems[1].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[63].SubItems[3].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[63].SubItems[5].Text = tb.Value.ToString();
            }
        }

        private void TrackBarItem64_ValueChanged(object sender, System.EventArgs e)
        {
            if (sender is TrackBar tb)
            {
                tronListViewControl1.TlvItems[64].SubItems[1].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[64].SubItems[3].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[64].SubItems[5].Text = tb.Value.ToString();
            }
        }

        private void TrackBarItem65_ValueChanged(object sender, System.EventArgs e)
        {
            if (sender is TrackBar tb)
            {
                tronListViewControl1.TlvItems[65].SubItems[1].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[65].SubItems[3].Text = tb.Value.ToString();
                tronListViewControl1.TlvItems[65].SubItems[5].Text = tb.Value.ToString();
            }
        }

        private void checkBoxFixHead_CheckedChanged(object sender, EventArgs e)
        {
            tronListViewControl1.FixedHeader = checkBoxFixHead.Checked;
            tronListViewControl1.Invalidate();
        }

        private void checkBoxScrollToCell_CheckedChanged(object sender, EventArgs e)
        {
            tronListViewControl1.ScrollToCell = checkBoxScrollToCell.Checked;
            tronListViewControl1.Invalidate();
        }

        private bool showmessage = true;
        private void comboBoxColorScheme_SelectedIndexChanged(object sender, EventArgs e)
        {
            int comboindex = comboBoxColorScheme.Items.IndexOf(comboBoxColorScheme.Text);

            if (comboindex < 0) return;
            else if (comboBoxColorScheme.Text == "default set" && comboindex == 0)
            {
                //Method.setPropertiesForTronListViewControl(Method.PropertySet.default_set);
                showmessage = true;
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.default_set);

                
            }
            else if (comboBoxColorScheme.Text == "default & backcolour" && comboindex == 1)
            {
                showmessage = false;
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.default_and_backcolour);

                /*
                tronListViewControl1.CanSingleClickSelectCell = false;
                tronListViewControl1.CanSingleClickSelectRow = false;

                tronListViewControl1.Colorimagefocus = Color.LightGreen;
                tronListViewControl1.Colorimagenotfocus = Color.LightGray;
                tronListViewControl1.Colorimageselect = Color.Aqua;
                tronListViewControl1.Coloreonotfocus = Color.LightGray;
                tronListViewControl1.Coloreoccfocus = Color.LightSalmon;
                tronListViewControl1.Colorcustcontfocusincedit = Color.LightPink;
                tronListViewControl1.Colorcustcontfocus = Color.LightGreen;
                tronListViewControl1.Colorccselect = Color.Yellow;
                tronListViewControl1.Colornotccselect = Color.Aqua;
                tronListViewControl1.Colorstdselect = Color.LightBlue;

                tronListViewControl1.Colorccselectdrag2 = Color.Orange;
                tronListViewControl1.Colornotccselectdrag2 = Color.Yellow;
                tronListViewControl1.Colorstdselectdrag2 = Color.LightYellow;

                tronListViewControl1.UseBackColorFocusDefCon = TronListViewControl.focusmode.both;

                tronListViewControl1.GridLineColor = Color.Gray;
                tronListViewControl1.GridLineColorHead = Color.DarkGray;
                tronListViewControl1.GridLineThicknessVertHead = 2;
                tronListViewControl1.GridLineThicknessHorzHead = 3;
                tronListViewControl1.GridLineThicknessHorzUnderHead = 4;
                tronListViewControl1.GridLineThicknessVert = 2;
                tronListViewControl1.GridLineThicknessHorz = 2;
                tronListViewControl1.GridGapHorzHead = 6;
                tronListViewControl1.GridGapHorzUnderHead = 4;
                tronListViewControl1.GridGapVertical = 4;
                tronListViewControl1.GridGapHorizontal = 4;
                tronListViewControl1.AllowHeaderEdit = true;
                tronListViewControl1.AllowDefaultControlEdit = true;
                tronListViewControl1.GridGapExtraTopBodyOn = false;
                tronListViewControl1.DoubleLineUnderHeader = false;
                tronListViewControl1.FontDefaultApply = true;
                tronListViewControl1.FontDefault = new Font("Microsoft Sans Serif", 8.25f);
                tronListViewControl1.FontHeaderApply = true;
                tronListViewControl1.FontHeader = new Font("Microsoft Sans Serif", 8.25f);
                tronListViewControl1.FontCustomApply = true;
                tronListViewControl1.FontCustom = new Font("Microsoft Sans Serif", 8.25f);
                tronListViewControl1.LineHeight = 18;
                tronListViewControl1.LineHeightHeader = 21;

                this.tronListViewControl1.BackColor = System.Drawing.SystemColors.ControlLight;
                this.tronListViewControl1.GridLineColor = System.Drawing.Color.Gray;
                this.tronListViewControl1.GridLineColorHead = System.Drawing.Color.Lime;
                */
            }
            else if (comboBoxColorScheme.Text == "def & bakcol only" && comboindex == 2)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.def_and_bakcol_only);
                showmessage = false;
                
            }
            else if (comboBoxColorScheme.Text == "LV Blue" && comboindex == 3)
            {
                showmessage = false;
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.LV_Blue);

                
            }
            else if (comboBoxColorScheme.Text == "LV All Blue" && comboindex == 4)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.LV_All_Blue);
                showmessage = false;
                /*
                tronListViewControl1.CanSingleClickSelectCell = false;
                tronListViewControl1.CanSingleClickSelectRow = false;

                tronListViewControl1.Colorimagefocus = Color.LightGreen;
                tronListViewControl1.Colorimagenotfocus = Color.LightGray;
                tronListViewControl1.Colorimageselect = Color.Blue;
                tronListViewControl1.Coloreonotfocus = Color.LightGray;
                tronListViewControl1.Coloreoccfocus = Color.LightGreen;
                tronListViewControl1.Colorcustcontfocusincedit = Color.LightPink;
                tronListViewControl1.Colorcustcontfocus = Color.LightGreen;
                tronListViewControl1.Colorccselect = Color.Blue;
                tronListViewControl1.Colornotccselect = Color.Blue;
                tronListViewControl1.Colorstdselect = Color.Blue;

                tronListViewControl1.Colorccselectdrag2 = Color.Blue;
                tronListViewControl1.Colornotccselectdrag2 = Color.Blue;
                tronListViewControl1.Colorstdselectdrag2 = Color.Blue;

                tronListViewControl1.UseBackColorFocusDefCon = TronListViewControl.focusmode.both;

                this.tronListViewControl1.DoubleLineUnderHeader = false;
                this.tronListViewControl1.FontCustom = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
                this.tronListViewControl1.FontCustomApply = true;
                this.tronListViewControl1.FontDefault = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
                this.tronListViewControl1.FontDefaultApply = true;
                this.tronListViewControl1.FontHeader = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
                this.tronListViewControl1.FontHeaderApply = true;
                this.tronListViewControl1.FullRowSelect = false;
                this.tronListViewControl1.GridGapExtraTopBodyOn = true;
                this.tronListViewControl1.GridGapHorizontal = 1;
                this.tronListViewControl1.GridGapHorzHead = 1;
                this.tronListViewControl1.GridGapHorzUnderHead = 1;
                this.tronListViewControl1.GridGapVertical = 2;
                this.tronListViewControl1.GridLineColor = System.Drawing.Color.Gray;
                this.tronListViewControl1.GridLineColorHead = System.Drawing.Color.Gray;
                this.tronListViewControl1.GridLineThicknessHorz = 1;
                this.tronListViewControl1.GridLineThicknessHorzHead = 1;
                this.tronListViewControl1.GridLineThicknessHorzUnderHead = 1;
                this.tronListViewControl1.GridLineThicknessVert = 1;
                this.tronListViewControl1.GridLineThicknessVertHead = 1;
                //this.tronListViewControl1.GridMode = TronLVC.TronListViewControl.gridMode.RequireStrictGrid;
                this.tronListViewControl1.GridVisible = true;
                this.tronListViewControl1.GridVisibleHead = true;
                this.tronListViewControl1.LineHeight = 18;
                this.tronListViewControl1.LineHeightHeader = 21;

                this.tronListViewControl1.BackColor = System.Drawing.SystemColors.ControlLight;
                this.tronListViewControl1.GridLineColor = System.Drawing.Color.Gray;
                this.tronListViewControl1.GridLineColorHead = System.Drawing.Color.Gray;
                */
            }
            else if (comboBoxColorScheme.Text == "LV All Blue bakcol only" && comboindex == 5)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.LV_All_Blue_bakcol_only);
                showmessage = false;
                
            }
            else if (comboBoxColorScheme.Text == "default plus" && comboindex == 6)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.default_plus);
                showmessage = false;
                
            }
            else if (comboBoxColorScheme.Text == "default plus small" && comboindex == 7)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.default_plus_small);
                showmessage = false;
                
            }
            else if (comboBoxColorScheme.Text == "LV All Blue small" && comboindex == 8)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.LV_All_Blue_small);
                showmessage = false;
                
            }
            else if (comboBoxColorScheme.Text == "LV All Blue small noGHead" && comboindex == 9)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.LV_All_Blue_small_noGHead);
                showmessage = false;
                
            }
            else if (comboBoxColorScheme.Text == "design set" && comboindex == 10)
            {
                showmessage = false;
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.design_set);

                //tp.ResetTlvpProperties(tronListViewControl1);
            }
            else if (comboBoxColorScheme.Text == "LV All Blue row" && comboindex == 11)
            {
                showmessage = false;
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.LV_All_Blue_row);

                
            }
            else if (comboBoxColorScheme.Text == "LV All Blue cell" && comboindex == 12)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.LV_All_Blue_cell);
                showmessage = false;
                
            }
            else if (comboBoxColorScheme.Text == "LV All Blue row & cell" && comboindex == 13)
            {
                tronListViewControl1.setPropertiesForTronListViewControl(Method.PropertySet.LV_All_Blue_row_and_cell);
                showmessage = false;
                
            }
            else MessageBox.Show("Combo list has changed.");
        }

        private void tronListViewControl1_Gotfocus(object sender, TlvMouseDownEventArgs args, EventArgs e)
        {
            tronListViewControl1.TlvItems[6].SubItems[0].Text = tronListViewControl1.pFocussedsubitem.row + ", " + tronListViewControl1.pFocussedsubitem.column;
            //textBox1.Text = "Row: " + tronListViewControl1.pFocussedsubitem.row + " Column: " + tronListViewControl1.pFocussedsubitem.column + " Value: " + tronListViewControl1.FocussedSubitemText;
            //textBox2.Text = "RowDI: " + tronListViewControl1.pFocussedSubitem_RowDI + " ColumnDI: " + tronListViewControl1.pFocussedSubitem_ColDI ;
            Control con = FindFocusedControl2(this);
            if (con != null)
                tronListViewControl1.TlvItems[7].SubItems[0].Text = con.Text;
            else tronListViewControl1.TlvItems[7].SubItems[0].Text = "null";
            tronListViewControl1.Invalidate();
        }

        public static Control FindFocusedControl(Control control)
        {
            var container = control as IContainerControl;
            while (container != null)
            {
                control = container.ActiveControl;
                container = control as IContainerControl;
            }
            return control;
        }

        public static Control FindFocusedControl2(Control container)
        {
            foreach (Control childControl in container.Controls)
            {
                if (childControl.Focused)
                {
                    return childControl;
                }
            }

            foreach (Control childControl in container.Controls)
            {
                Control maybeFocusedControl = FindFocusedControl2(childControl);
                if (maybeFocusedControl != null)
                {
                    return maybeFocusedControl;
                }
            }

            return null;
        }

        private void tronListViewControl1_SetPictureBoxProperties(object sender, PBTlvSIEventArgs args)
        {
            if (args.subItemIndex == 0)
            {
                PictureBox pb = args.pictureBox;
                if (pb != null)
                    pb.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
            }
        }

        private void tronListViewControl1_SelectCellsAction(object sender, SelectCellsEventArgs args)
        {
            if (args.isSecondPhaseAction)
            {
                MessageBox.Show("isSecondPhaseAction");
            }
        }

        private void tronListViewControl1_ActionSelection(object sender, TlvSIEventArgsNC args)
        {
            if (args.isSecondPhaseAction)
            {
                if (args.focussedsubitem.selected == TronListViewControl.selectionmode.selectedcell)
                    MessageBox.Show("isSecondPhaseAction - selectedcell");
                else if (args.focussedsubitem.selected == TronListViewControl.selectionmode.selectedrowandcell)
                    MessageBox.Show("isSecondPhaseAction - selectedrowandcell");
            }
        }

        private void tronListViewControl1_KeyDown(object sender, KeyEventArgs e, TronListViewLibrary.TronListViewControl.Timing timing)
        {
            if(e.KeyData == Keys.F1 && timing == TronListViewControl.Timing.before)
            {
                TronListViewControl.TronListViewInfo();
            }
            
            if (timing == TronListViewControl.Timing.after)
            {
                tronListViewControl1.TlvItems[6].SubItems[0].Text = tronListViewControl1.pFocussedsubitem.row + ", " + tronListViewControl1.pFocussedsubitem.column;
                tronListViewControl1.Invalidate();
                textBox1.Text = "Row: " + tronListViewControl1.pFocussedsubitem.row + " Column: " + tronListViewControl1.pFocussedsubitem.column + " Value: " + tronListViewControl1.FocussedSubitemText;
                textBox2.Text = "RowDI: " + tronListViewControl1.pFocussedSubitem_RowDI + " ColumnDI: " + tronListViewControl1.pFocussedSubitem_ColDI;
            }
            //textBox1.Text = "Row: " + tronListViewControl1.pFocussedsubitem.row + " Column: " + tronListViewControl1.pFocussedsubitem.column + " Value: " + tronListViewControl1.FocussedSubitemText;
            //textBox1.Invalidate();
        }

        private void tronListViewControl1_MouseDown(object sender, TlvMouseDownEventArgs args, MouseEventArgs e, ref bool cancelheadermenu, bool F4Key,  TronListViewControl.Timing timing)
        {
            if(e.Button == MouseButtons.Right && timing == TronListViewControl.Timing.before)
            {                
                Control control = sender as Control;
                if (control != null)
                {
                    if (args.methodmode == MouseDownExecMethod.customcontrol)
                    {
                        if (control is TextBoxEmbeddedControl)
                            contextMenuStripTextBox.Show(control, new Point(control.Bounds.Width, control.Bounds.Height));
                        else if (args.ccmode == MouseDownCustControlMode.clickcontrol)
                            contextMenuStripEOClickControl.Show(control, new Point(control.Bounds.Width, control.Bounds.Height));
                        else if (args.ccmode == MouseDownCustControlMode.datadisplayonly)
                            contextMenuStripEoDisplay.Show(control, new Point(control.Bounds.Width, control.Bounds.Height));
                        else if (args.ccmode == MouseDownCustControlMode.datanumericinput)
                            contextMenuStripEoInput.Show(control, new Point(control.Bounds.Width, control.Bounds.Height));
                        else if (args.ccmode == MouseDownCustControlMode.nul)
                            contextMenuStripEO.Show(control, new Point(control.Bounds.Width, control.Bounds.Height));
                    }
                    else if (args.methodmode == MouseDownExecMethod.defaultcontrol)
                        contextMenuStripDef.Show(control, new Point(control.Bounds.Width, control.Bounds.Height));
                    else if (args.methodmode == MouseDownExecMethod.headercontrol)
                    {
                        if (!checkBoxDefHeadMenu.Checked)
                        {
                            cancelheadermenu = true;
                            contextMenuStripHead.Show(control, new Point(control.Bounds.Width, control.Bounds.Height));
                        }
                    }
                    else if (args.methodmode == MouseDownExecMethod.pictureboxcontrol)
                        contextMenuStripPB.Show(control, new Point(control.Bounds.Width, control.Bounds.Height));
                }
                //MessageBox.Show("right click"); 
            }

            if (timing == TronListViewControl.Timing.after)
            {
                tronListViewControl1.TlvItems[6].SubItems[0].Text = tronListViewControl1.pFocussedsubitem.row + ", " + tronListViewControl1.pFocussedsubitem.column;                
                tronListViewControl1.Invalidate();
                textBox1.Text = "Row: " + tronListViewControl1.pFocussedsubitem.row + " Column: " + tronListViewControl1.pFocussedsubitem.column + " Value: " + tronListViewControl1.FocussedSubitemText;
                textBox2.Text = "RowDI: " + tronListViewControl1.pFocussedSubitem_RowDI + " ColumnDI: " + tronListViewControl1.pFocussedSubitem_ColDI ;
            }
        }

        private void buttonTest_Click(object sender, EventArgs e)
        {
            tronListViewControl1.TlvItems.Delete(2);

            //return;

            StringBuilder sb = new StringBuilder();
            sb.AppendLine("List<EmbeddedObject>");

            List<EmbeddedObject> eol = tronListViewControl1.getEmbeddedObjectList();
            //string line = "";
            foreach(EmbeddedObject eo in eol)
            {
                sb.AppendLine("Row " + eo.row + " Coloumn " + eo.column + "  " + eo.eotype.ToString());
            }

            int j = 0;
            sb.AppendLine("");
            sb.AppendLine("Reverse Column order");
            foreach(int i in tronListViewControl1.pReverseColord)
            {
                sb.AppendLine("Index " + j++ + " RC " + i);
            }
            sb.AppendLine("");
            sb.AppendLine("Reverse Row order");
            j = 0;
            foreach (int i in tronListViewControl1.pReverseRoword)
            {
                sb.AppendLine("Index " + j++ + " RR " + i);
            }
            sb.AppendLine("");
            sb.AppendLine("");

            FormDebug fd = new FormDebug(sb) { StartPosition = FormStartPosition.CenterParent };
            fd.ShowDialog(this);

            /*
            int[] input = new int[tronListViewControl1.TlvColumns.Count];
            for (int i = 0; i < tronListViewControl1.TlvColumns.Count; i++)
            {
                TLVCColumn col = tronListViewControl1.TlvColumns[i];
                input[i] = col.DisplayIndex;
                MessageBox.Show("orig " + i + ", di " + col.DisplayIndex.ToString());
            }
            string colord = "Colord ";
            foreach(int i in tronListViewControl1.pColord)
            {
                colord += i + " ";
            }
            MessageBox.Show(colord);
            string revcolord = "ReverseColord ";
            foreach (int i in tronListViewControl1.pReverseColord)
            {
                revcolord += i + " ";
            }
            MessageBox.Show(revcolord);
            */
        }

        private void tronListViewControl1_AfterLabelEdit(object sender, TlvSIEventArgsNC args, string json)
        {
            if (showmessage) MessageBox.Show("(" + args.itemindex + "," + args.subItemIndex + ") " + " reord(" + args.reorderedItemindex + "," + args.reorderedSubItemIndex + ") " + args.subItem.Text + " phase " + (args.isSecondPhaseAction ? "second" : "first"));
        }