Reputation: 2491
I need to set a panel.Left property equal to a ToolStripButton.Left value:
pan1.Left = btn1.Left;
but there is no such property for ToolStripButton. Is there a solution, please.
If there is no - how to place the panel on the center of a Form.
Upvotes: 1
Views: 251
Reputation: 2491
this works:
pan1.Location = new Point(btn1.Bounds.X,pan1.Location.Y);
Upvotes: 1
Reputation: 11277
You don't need any kind of control
to infer center, but form itself:
panel1.Left = this.ClientSize.Width / 2 - panel1.Width / 2;
Upvotes: 1