代码改变世界

3

2017-09-26 11:40  xx--  阅读(288)  评论(0编辑  收藏  举报

1.主菜单:

2.工具栏:

点击下三角选择button类型

修改添加的按钮属性中的displaystyle为text

3.状态栏

4.点击事件

 

 修改窗体大小代码:

 private void 大ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Size = new Size(300, 200);
            toolStripStatusLabel1.Text = "中窗体";
        }

 修改背景色代码:

private void 大ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.BackColor = Color.Red;
            toolStripStatusLabel1.Text = "红色";
        }

 修改前景色代码:

private void 大ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.ForeColor = Color.Purple;
            toolStripStatusLabel1.Text = "紫色";
        }

 修改文字位置代码:

private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Point x = new Point(10, 100);
            label1.Location = x;
            toolStripStatusLabel1.Text = "";
        }