我正在使用C#Windows窗体应用程序创建一个程序。
让我告诉你我正在做的事情:
有谁知道如何重做"重做"登录后的主菜单,具体取决于权限值?
答案 0 :(得分:0)
也许这个?
const int firstButtonY = 20;
const int padding = 20;
int currentY = firstButtonY;
foreach (var control in this.Controls)
{
if (control.GetType() != typeof(System.Windows.Forms.Button))
continue;
var curButton = (Button) control;
if (!curButton.Visible)
continue;
curButton.Top = currentY;
currentY += padding + curButton.Height;
}
答案 1 :(得分:0)
而不是在Form1_Load
frm3 = new Form3(this);
并在指定的事件触发器
之后显示frm3.Show();
并取消Form3_Closing
private void Form3_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.Hide();
}
frm3 = new Form3(this);
frm3.Show();
并在Form1_Load
//frm3 = new Form3(this);
并评论隐藏form3部分
private void Form3_FormClosing(object sender, FormClosingEventArgs e)
{
//e.Cancel = true;
//this.Hide();
}
因为form frm3.Show()
之后的this.Hide()
不会触发
private void Form3_Load(object sender, EventArgs e)