public static void MakeLayoutContol3(FlowLayoutPanel flowLayoutPanel, string _valString) { List <MyDatabaseConnect01.DataThreeVo> resultList = new MyDatabaseConnect01().connection3(_valString); //flowLayoutPanel.Size = new Size(3000, 2000); //flowLayoutPanel.WrapContents = false; // https://www.dotnetperls.com/flowlayoutpanel // https://www.c-sharpcorner.com/forums/getting-control-from-flowlayoutpanel // https://stackoverflow.com/questions/40279918/flowlayoutpanel-scrollbar-doesnt-disapear-properly-sometimes flowLayoutPanel.HorizontalScroll.Maximum = 0; flowLayoutPanel.AutoScroll = false; flowLayoutPanel.VerticalScroll.Visible = false; flowLayoutPanel.AutoScroll = true; MyUserControl02 userControl; int _rowIndex = 0; for (int x = 0; x < resultList.Count; x++) { userControl = new MyUserControl02(resultList[x].EQP_DESC.ToString(), resultList[x].EQP_ID.ToString(), resultList[x].WORK_CENTER.ToString(), resultList[x].STATE.ToString()); flowLayoutPanel.Controls.Add(userControl); } }
//public static void MakeLayoutContol2(LayoutControlGroup layoutControlGroup, string _valString) //{ // List<DataThreeVo> resultList = new MyDatabaseConnect01().connection3(_valString); // layoutControlGroup.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; // layoutControlGroup.GroupBordersVisible = false; // layoutControlGroup.LayoutMode = DevExpress.XtraLayout.Utils.LayoutMode.Table; // layoutControlGroup.Location = new Point(0, 0); // layoutControlGroup.Name = "layoutControlGroup"; // for (int x = 0; x < 11; x++) // { // layoutControlGroup.OptionsTableLayoutGroup.ColumnDefinitions.Add(new ColumnDefinition() { Width = 120D, SizeType = SizeType.Absolute }); // } // layoutControlGroup.OptionsTableLayoutGroup.ColumnDefinitions.Add(new ColumnDefinition() { Width = 2D, SizeType = SizeType.Absolute }); // for (int x = 0; x < (resultList.Count + 1) / 6; x++) // { // layoutControlGroup.OptionsTableLayoutGroup.RowDefinitions.Add(new RowDefinition() { Height = 200D, SizeType = SizeType.Absolute }); // } // layoutControlGroup.Size = new Size(3000, 2000); // layoutControlGroup.TextVisible = false; // LayoutControlItem controlItem; // MyUserControl02 userControl; // int _rowIndex = 0; // for (int x = 0; x < resultList.Count; x++) // { // controlItem = new LayoutControlItem() { TextVisible = false }; // if ((x + 1) % 6 == 0) // { // _rowIndex += 1; // } // controlItem.OptionsTableLayoutItem.RowIndex = _rowIndex; // if ((x + 1) % 6 == 1) // { // controlItem.OptionsTableLayoutItem.ColumnIndex = 0; // } // else if ((x + 1) % 6 == 2) // { // controlItem.OptionsTableLayoutItem.ColumnIndex = 1; // } // else if ((x + 1) % 6 == 3) // { // controlItem.OptionsTableLayoutItem.ColumnIndex = 2; // } // else if ((x + 1) % 6 == 4) // { // controlItem.OptionsTableLayoutItem.ColumnIndex = 3; // } // else if ((x + 1) % 6 == 5) // { // controlItem.OptionsTableLayoutItem.ColumnIndex = 4; // } // else if ((x + 1) % 6 == 0) // { // controlItem.OptionsTableLayoutItem.ColumnIndex = 5; // controlItem.OptionsTableLayoutItem.RowIndex = _rowIndex - 1; // } // userControl = new MyUserControl02(resultList[x].EQP_DESC.ToString(), resultList[x].EQP_ID.ToString(), "", ""); // controlItem.Control = userControl; // layoutControlGroup.Items.AddRange(new BaseLayoutItem[] { controlItem }); // } //} public static void MakeLayoutContol(LayoutControlGroup layoutControlGroup, string _valString) { List <MyDatabaseConnect01.DataFourVo> resultList = new MyDatabaseConnect01().connection6(_valString); layoutControlGroup.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; layoutControlGroup.GroupBordersVisible = false; layoutControlGroup.LayoutMode = DevExpress.XtraLayout.Utils.LayoutMode.Table; layoutControlGroup.Location = new Point(0, 0); layoutControlGroup.Name = "layoutControlGroup"; layoutControlGroup.OptionsTableLayoutGroup.ColumnDefinitions.Add(new ColumnDefinition() { Width = 100D, SizeType = SizeType.Percent }); for (int x = 0; x < resultList.Count + 1; x++) { layoutControlGroup.OptionsTableLayoutGroup.RowDefinitions.Add(new RowDefinition() { Height = 100D, SizeType = SizeType.Absolute }); } layoutControlGroup.Size = new Size(796, 620); layoutControlGroup.TextVisible = false; LayoutControlItem controlItem; MyUserControl01 userControl; for (int x = 0; x < resultList.Count; x++) { controlItem = new LayoutControlItem() { TextVisible = false }; controlItem.OptionsTableLayoutItem.RowIndex = x; //// Run 초록 //if (resultList[x].STATE.ToString() == "Run") //{ // userControl = new MyUserControl01(resultList[x].EQP_DESC.ToString() + (x + 1), Color.FromArgb(0x3E, 0x70, 0x38), 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 10 + new Random().Next(-5, 5)); // controlItem.Control = userControl; //} //else if (resultList[x].STATE.ToString() == "Idle" || resultList[x].STATE.ToString() == "Ready") //{ // userControl = new MyUserControl01(resultList[x].EQP_DESC.ToString() + (x + 1), Color.DarkGray, 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 10 + new Random().Next(-5, 5)); // controlItem.Control = userControl; //} //else if (resultList[x].STATE.ToString() == "Down") //{ // userControl = new MyUserControl01(resultList[x].EQP_DESC.ToString() + (x + 1), Color.OrangeRed, 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 10 + new Random().Next(-5, 5)); // controlItem.Control = userControl; //} //else if (resultList[x].STATE.ToString() == "SetUp") //{ // userControl = new MyUserControl01(resultList[x].EQP_DESC.ToString() + (x + 1), Color.FromArgb(0x00, 0x73, 0xC4), 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 10 + new Random().Next(-5, 5)); // controlItem.Control = userControl; //} userControl = new MyUserControl01(resultList[x].EQP_ID.ToString(), Color.FromArgb(0x00, 0x73, 0xC4), 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 100 + new Random().Next(-5, 5)); controlItem.Control = userControl; layoutControlGroup.Items.AddRange(new BaseLayoutItem[] { controlItem }); } }