【发布时间】:2014-01-10 19:07:34
【问题描述】:
我有带有一些按钮的工具条菜单,菜单位于工具条容器中。我想要完成的是在特定的工具条按钮位置打开新表单......这是我的代码。除非我将工具条菜单移动到工具条容器的底部或右侧...
private System.Windows.Forms.ToolStripButton rbRunMacro;
private System.Windows.Forms.ToolStrip tsMacroRecorder;
private void rbRunMacro_Click(object sender, EventArgs e)
{
Rectangle rect = this.rbRunMacro.Bounds;
Point location = PointToScreen ( new Point(this.tsMacroRecorder.Location.X + rect.X, this.tsMacroRecorder.Location.Y + rect.Y));
MacroListForm form = new MacroListForm();
form.StartPosition = FormStartPosition.Manual;
form.Location = location ;
form.Show();
}
【问题讨论】:
标签: c# winforms toolstripitem