3单元C#练习(重复太多,差别着写)

3_1.

重要点:1.改变大小主要在click和size。size要new。

2.窗体大小显示是在toolStripStatusLable 的text。

3.新老版本的控件名称差异ToolBarButton——ToolStripMenu,ToolBarPanel——toolStripStatusLable。

4.窗体的大小也要设置。

Test3_2

Backcolor=Color.Blue;    toolStripStatusLabel1.Text = "蓝色";

Test3_4

 private void toolStripLabel2_Click(object sender, EventArgs e)
        {
            label1.Location = new Point(50, 100);//改变控件Label的位置
           // this.Size = new Size(300, 200);
            //this.toolStripStatusLabel1.Text = "中";
            toolStripStatusLabel1.Text = "中";
        }


 

test3_9

private void toolStripLabel1_Click(object sender, EventArgs e)
        {
            this.BackgroundImage = Image.FromFile(@"D:a.jpg");
           // label1.Location = new Point(10, 100);
            //this.Location = new Point(10,100);
            //this.toolStripStatusLabel1.Text = "大";
            toolStripStatusLabel1.Text = "A";
        }

附加:1.改变鼠标显示    this.Cursor = Cursors.Default;(默认)/WaitCursor;(等待)/Cross;(十字)

2.右键快捷键:private void Form1_Load(object sender, EventArgs e)
    { 

       this.ContextMenuStrip = this.contextMenuStrip1;

    }

                                

原文地址:https://www.cnblogs.com/7-58843117/p/7594678.html