Form.ShowIcon Form.ShowIcon Form.ShowIcon Form.ShowIcon Property


获取或设置一个值,该值指示是否在窗体的标题栏中显示图标。Gets or sets a value indicating whether an icon is displayed in the caption bar of the form.

 property bool ShowIcon { bool get(); void set(bool value); };
public bool ShowIcon { get; set; }
member this.ShowIcon : bool with get, set
Public Property ShowIcon As Boolean


如果窗体在标题栏中显示图标,则为 true;否则为 falsetrue if the form displays an icon in the caption bar; otherwise, false. 默认值为 trueThe default is true.


ShowIcon属性包含Boolean值,该值指示是否在窗体的Icon窗体的标题栏中显示。The ShowIcon property contains a Boolean value that indicates whether the form's Icon is displayed in the caption bar of the form. 如果ControlBox属性是false,将禁止显示的图标和控件框。If the ControlBox property is false, both the icon and control box will be suppressed.

如果ShowIconfalse主窗体显示时,将应用程序在任务栏按钮中显示通用图标。If ShowIcon is false when the primary form is shown, a generic icon will be displayed in the taskbar button for the application.

此属性如果不起作用FormBorderStyle设置为FixedDialogThis property has no effect if FormBorderStyle is set to FixedDialog. 在这种情况下,窗体不显示一个图标。In that case, the form does not display an icon.