WindowChrome.CaptionHeight 属性


获取或设置窗口顶部标题区域的高度。Gets or sets the height of the caption area at the top of a window.

 property double CaptionHeight { double get(); void set(double value); };
public double CaptionHeight { get; set; }
member this.CaptionHeight : double with get, set
Public Property CaptionHeight As Double



标题区域的高度。The height of the caption area.


设置 CaptionHeight 属性以指定窗口顶部的区域,该区域启用通常与标题栏关联的系统行为。Set the CaptionHeight property to specify the area at the top of the window that enables the system behaviors typically associated with the title bar. 这些行为包括双击以最大化窗口,右键单击打开 "系统" 菜单,然后单击并拖动以移动窗口。These behaviors include double-click to maximize the window, right-click to open the system menu, and click-and-drag to move the window. 此属性可设置为任何非负双精度值。This property can be set to any non-negative double value.

属性定义的区域 CaptionHeight 从顶部调整大小边框的下边缘开始,并向下扩展指定的量。The area defined by the CaptionHeight property starts at the bottom edge of the top resize border and extends downward the specified amount. 它跨越右侧和左侧大小调整边框内的窗口宽度。It spans the width of the window inside the right and left resize borders. 此区域没有任何与之关联的可视元素;它仅用于定义对标题栏行为进行响应的区域。This area does not have any visual elements associated with it; it is only used to define the region that responds to the title bar behaviors. 默认情况下,窗口的标题区内的任何可视元素部分都不是交互式的。By default, the parts of any visual elements that are within the caption area of the window are not interactive. 若要启用标题区中的交互式元素,请将 IsHitTestVisibleInChrome 附加属性附加到元素,并将其设置为 trueTo enable interactive elements in the caption area, attach the IsHitTestVisibleInChrome attached property to the element and set it to true.

依赖项属性信息Dependency Property Information

标识符字段Identifier field CaptionHeightProperty
元数据属性设置为 trueMetadata properties set to true None