ToolStrip.LayoutCompleted 事件

定义

ToolStrip 的布局完成时发生。

public:
 event EventHandler ^ LayoutCompleted;
public event EventHandler LayoutCompleted;
public event EventHandler? LayoutCompleted;
member this.LayoutCompleted : EventHandler 
Public Custom Event LayoutCompleted As EventHandler 

事件类型

示例

下面的代码示例演示了此成员的用法。 在此示例中,事件处理程序报告事件的发生情况 LayoutCompleted 。 此报表可帮助你了解事件发生的时间,并可以帮助你进行调试。 若要报告多个事件或频繁发生的事件,请考虑将 MessageBox.Show 替换为 Console.WriteLine 或将消息追加到多行 TextBox

若要运行示例代码,请将其粘贴到包含名为 ToolStrip1的 类型的ToolStrip实例的项目中。 然后,确保事件处理程序与 LayoutCompleted 事件相关联。

private void ToolStrip1_LayoutCompleted(Object sender, EventArgs e) {

   MessageBox.Show("You are in the ToolStrip.LayoutCompleted event.");
}
Private Sub ToolStrip1_LayoutCompleted(sender as Object, e as EventArgs) _ 
     Handles ToolStrip1.LayoutCompleted

   MessageBox.Show("You are in the ToolStrip.LayoutCompleted event.")

End Sub

注解

ToolStrip 不能容纳项时,溢出按钮会自动出现。 Overflow 属性设置确定项是始终、根据需要还是从不出现在溢出区域中。

Placement检查 事件中的 LayoutCompleted 属性,以确定项是放置在main ToolStrip、溢出 ToolStrip上,还是当前根本未显示。 项未显示的典型原因是主 ToolStrip 中不能容纳项,并且其 Overflow 属性设置为 Never

有关处理事件的详细信息,请参阅 处理和引发事件

适用于