我有一些带有一些按钮的工具栏菜单,菜单位于工具条容器中。我想要完成的是在特定的工具条按钮位置打开新表单...这是我的代码。除非我将工具条菜单移动到工具条容器的底部或右侧,否则它会起作用...
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();
}