控件问题
帮忙看下怎么排列不乱 谢谢各位了private void button2_Click(object sender, EventArgs e)
{
listView1.Dock = DockStyle.None;
button2.Dock = DockStyle.Top;
button1.SendToBack();
button1.Dock = DockStyle.Top;
button3.Dock = DockStyle.Bottom;
button4.Dock = DockStyle.Bottom;
button5.Dock = DockStyle.Bottom;
listView1.Dock = DockStyle.Bottom;
listView1.Clear();
listView1.Items.Add("近期工作记录", "近期工作记录", 3);
listView1.Items.Add("近期工作计划", "近期工作计划", 4);
}
private void button3_Click(object sender, EventArgs e)
{
listView1.Dock = DockStyle.None;
button3.Dock = DockStyle.Top;
button2.SendToBack();
button2.Dock = DockStyle.Top;
button1.Dock = DockStyle.Bottom;
button4.Dock = DockStyle.Bottom;
button5.Dock = DockStyle.Bottom;
listView1.Dock = DockStyle.Bottom;
listView1.Clear();
listView1.Items.Add("近期工作记录", "近期工作记录", 5);
listView1.Items.Add("近期工作计划", "近期工作计划", 6);
}
private void button4_Click(object sender, EventArgs e)
{
listView1.Dock = DockStyle.None;
button4.Dock = DockStyle.Top;
button3.SendToBack();
button3.Dock = DockStyle.Top;
button2.Dock = DockStyle.Bottom;
button1.Dock = DockStyle.Bottom;
button5.Dock = DockStyle.Bottom;
listView1.Dock = DockStyle.Bottom;
listView1.Clear();
listView1.Items.Add("编辑工作进度报告", "编辑工作进度报告", 7);
listView1.Items.Add("编辑项目设计图", "编辑项目设计图", 8);
}
private void button5_Click(object sender, EventArgs e)
{
listView1.Dock = DockStyle.None;
button5.SendToBack();
button5.Dock = DockStyle.Top;
button4.SendToBack();
button4.Dock = DockStyle.Top;
button3.SendToBack();
button3.Dock = DockStyle.Top;
button2.SendToBack();
button2.Dock = DockStyle.Top;
button1.SendToBack();
button1.Dock = DockStyle.Top;
listView1.Dock = DockStyle.Bottom;
listView1.Clear();
listView1.Items.Add("编辑工作进度报告", "编辑工作进度报告", 9);
listView1.Items.Add("编辑项目设计图", "编辑项目设计图", 10);
}
private void button1_Click(object sender, EventArgs e)
{
listView1.Dock = DockStyle.None;
button1.Dock = DockStyle.Top;
button2.Dock = DockStyle.Bottom;
button3.Dock = DockStyle.Bottom;
button4.Dock = DockStyle.Bottom;
button5.SendToBack();
button5.Dock = DockStyle.Bottom;
listView1.BringToFront();
listView1.Dock = DockStyle.Bottom;
listView1.Clear();
listView1.Items.Add("设置上下班时间", "设置上下班时间", 0);
listView1.Items.Add("是否启用短信提醒", "是否启用短信提醒", 1);
listView1.Items.Add("设置密码", "设置密码", 2);
}