2020年12月20日星期日

How can I change the size of a button in a cell of FlexGrid (Windows Form)

   private void SetButton(C1FlexGrid fg, int row, int col)          {               CellStyle cs;            Button button1 = new Button();             button1.Size = new Size(10,10);                     cs = fg.Styles.Add("Button");                        cs.BackgroundImage = imageList1.Images[(int)ImageListNo.Button];            cs.BackgroundImageLayout = ImageAlignEnum.CenterCenter;            cs.BackColor = SystemColor.control;                           button1.Click += new System.EventHandler(button1_Click);                  cs.Editor = button1;                                C1.Win.C1FlexGrid.CellRange rg;            rg = fg.GetCellRange(row, col);                        rg.Style = fg.Styles["Button"];          }  

I want to set a button and date togerher in one cell of FlexGrid. I could add a button docked in one cell but I want to set a smaller button so that I can show date above the button.

Even if I changed the size of the button the size doesn't change at all so I am wondering why....

https://stackoverflow.com/questions/65386712/how-can-i-change-the-size-of-a-button-in-a-cell-of-flexgrid-windows-form December 21, 2020 at 10:05AM

没有评论:

发表评论