你可以使用:
Nextbutton.Visible = True; //initially
backbutton.Visible = False; //initially
printbutton.Visible = False; //initially
backbutton.Enabled = False; //initially to prevent tabbing to the control and clicking on it
printbutton.Enabled = False; //initially to prevent tabbing to the control and clicking on it
,然后在事件处理程序(一个或多个)设置
backbutton.Visible = True;
printbutton.Visible = True;
backbutton.Enabled = True;
printbutton.Enabled = True;
您甚至可以设定printButton和后退按钮的位置,最初,他们只是将不可见但在你想要他们的位置。
另外,如果你需要设置位置使用:
someButton.Location = //some location on your form and move all three buttons as needed.
如果你希望他们能够相互抵消,你甚至可以这样做:
someButton.Location = (otherButton.Location +- /*Some offset*/) ;
这里真的没有好的答案。有第三方的布局生成器(这就是我用过的),但通常在WPF之前,您必须依赖如下定义的锚定规则:[link](http://msdn.microsoft.com/en-us/library /ms951306.aspx) – akhisp 2012-02-04 23:40:50
@ akhisp你可以使用位置和可见来编程实现它,甚至可以基于任何其他按钮位置(甚至任何其他控件的位置)在窗体内动态计算它 – jordanhill123 2012-02-04 23:49:42
@Mouhammed Soueidane您正在使用的WinForms? – jordanhill123 2012-02-04 23:50:22