日期:2014-05-17  浏览次数:20774 次

C#窗体里我用代码创建了一个groupbox控件,接着绘制了一个长方形,长方形不显示,这是为什么?
                   if (item.Key.ToString() == "编码控制器")
                    {
                        GroupBox groupbox = new GroupBox();
                        groupbox.Text = "编码控制器";
                        groupbox.Location = new Point(20, 20);
                        groupbox.Size = new Size(530, 200);
                        groupbox.BackColor = Color.Transparent;
                        this.Controls.Add(groupbox);

                        IList i_cc = item.Value;
                        for (int i = 0; i < i_cc.Count; i++)
                        {

                            System.DateTime curr_time = System.DateTime.Now;
                            string tt = curr_time.ToString();
                            Label label = new Label();
                            label.Text = tt;
                            label.Location = new Point(30 + 180 * i, 60);