ToolTip.Show ToolTip.Show ToolTip.Show ToolTip.Show Method

定义

设置与工具提示关联的文本,然后显示该工具提示。Sets the text associated with a ToolTip, and then displays it.

重载

Show(String, IWin32Window, Int32, Int32) Show(String, IWin32Window, Int32, Int32) Show(String, IWin32Window, Int32, Int32) Show(String, IWin32Window, Int32, Int32)

设置与指定控件关联的工具提示文本,然后在指定的相对位置以模式方式显示该工具提示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip modally at the specified relative position.

Show(String, IWin32Window, Point, Int32) Show(String, IWin32Window, Point, Int32) Show(String, IWin32Window, Point, Int32)

设置与指定控件关联的工具提示文本,然后在指定的相对位置和在指定的时间段内保持该工具提示的显示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration at the specified relative position.

Show(String, IWin32Window, Int32, Int32, Int32) Show(String, IWin32Window, Int32, Int32, Int32) Show(String, IWin32Window, Int32, Int32, Int32) Show(String, IWin32Window, Int32, Int32, Int32)

设置与指定控件关联的工具提示文本,然后在指定的相对位置和在指定的时间段内保持该工具提示的显示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration at the specified relative position.

Show(String, IWin32Window, Point) Show(String, IWin32Window, Point) Show(String, IWin32Window, Point)

设置与指定控件关联的工具提示文本,然后在指定的相对位置以模式方式显示该工具提示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip modally at the specified relative position.

Show(String, IWin32Window) Show(String, IWin32Window) Show(String, IWin32Window) Show(String, IWin32Window)

设置与指定控件关联的工具提示文本,然后以模式方式显示工具提示。Sets the ToolTip text associated with the specified control, and displays the ToolTip modally.

Show(String, IWin32Window, Int32) Show(String, IWin32Window, Int32) Show(String, IWin32Window, Int32) Show(String, IWin32Window, Int32)

设置与指定控件关联的工具提示文本,然后在指定时间段内保持该工具提示的显示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration.

Show(String, IWin32Window, Int32, Int32) Show(String, IWin32Window, Int32, Int32) Show(String, IWin32Window, Int32, Int32) Show(String, IWin32Window, Int32, Int32)

设置与指定控件关联的工具提示文本,然后在指定的相对位置以模式方式显示该工具提示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip modally at the specified relative position.

public:
 void Show(System::String ^ text, System::Windows::Forms::IWin32Window ^ window, int x, int y);
public void Show (string text, System.Windows.Forms.IWin32Window window, int x, int y);
member this.Show : string * System.Windows.Forms.IWin32Window * int * int -> unit
Public Sub Show (text As String, window As IWin32Window, x As Integer, y As Integer)

参数

text
String String String String

包含新工具提示文本的 StringA String containing the new ToolTip text.

window
IWin32Window IWin32Window IWin32Window IWin32Window

要为其显示工具提示的 ControlThe Control to display the ToolTip for.

x
Int32 Int32 Int32 Int32

用来显示工具提示的水平偏移量(以像素为单位),该偏移量相对于关联控件窗口的左上角。The horizontal offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip.

y
Int32 Int32 Int32 Int32

用来显示工具提示的垂直偏移量(以像素为单位),该偏移量相对于关联控件窗口的左上角。The vertical offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip.

注解

此版本的重载Show方法Show(String, IWin32Window, Point)与版本相同, 不同之处在于, 偏移量指定为单独的 x 坐标和 y 坐标而不Point是。This version of the overloaded Show method operates identically to the Show(String, IWin32Window, Point) version, except that the offset is specified as separate x- and y-coordinates instead of a Point.

在部分信任环境中运行的应用AllWindows程序必须断言使用此方法的Show权限, 因为它可控制与用户操作无关的工具提示的显示和位置。Applications running in partial trust must assert the AllWindows permission to use this method, as Show can control the display and location of a ToolTip independent of user action.

安全性

UIPermission
需要AllWindows权限。Requires AllWindows permission.

另请参阅

Show(String, IWin32Window, Point, Int32) Show(String, IWin32Window, Point, Int32) Show(String, IWin32Window, Point, Int32)

设置与指定控件关联的工具提示文本,然后在指定的相对位置和在指定的时间段内保持该工具提示的显示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration at the specified relative position.

public:
 void Show(System::String ^ text, System::Windows::Forms::IWin32Window ^ window, System::Drawing::Point point, int duration);
public void Show (string text, System.Windows.Forms.IWin32Window window, System.Drawing.Point point, int duration);
member this.Show : string * System.Windows.Forms.IWin32Window * System.Drawing.Point * int -> unit

参数

text
String String String String

包含新工具提示文本的 StringA String containing the new ToolTip text.

window
IWin32Window IWin32Window IWin32Window IWin32Window

要为其显示工具提示的 ControlThe Control to display the ToolTip for.

point
Point Point Point Point

包含用来显示工具提示的偏移量(以像素为单位)的 Point,该偏移量相对于关联控件窗口的左上角。A Point containing the offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip.

duration
Int32 Int32 Int32 Int32

包含工具提示持续显示时间(以毫秒为单位)的 Int32An Int32 containing the duration, in milliseconds, to display the ToolTip.

异常

window 参数为 nullThe window parameter is null.

注解

pt参数可以指定关联控件、其父窗体甚至是桌面边界之外的位置。The pt parameter can specify a position outside the bounds of the associated control, its parent form, or even the desktop. 工具提示位于关联控件的中心。The ToolTip is positioned in the center of the associated control. 若要以模式方式显示工具提示Show(String, IWin32Window, Point) , 请改为调用此方法的重载版本。To display the ToolTip modally, call the Show(String, IWin32Window, Point) overloaded version of this method instead.

在部分信任环境中运行的应用AllWindows程序必须断言使用此方法的Show权限, 因为它可控制与用户操作无关的工具提示的显示和位置。Applications running in partial trust must assert the AllWindows permission to use this method, as Show can control the display and location of a ToolTip independent of user action.

安全性

UIPermission
需要AllWindows权限。Requires AllWindows permission.

另请参阅

Show(String, IWin32Window, Int32, Int32, Int32) Show(String, IWin32Window, Int32, Int32, Int32) Show(String, IWin32Window, Int32, Int32, Int32) Show(String, IWin32Window, Int32, Int32, Int32)

设置与指定控件关联的工具提示文本,然后在指定的相对位置和在指定的时间段内保持该工具提示的显示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration at the specified relative position.

public:
 void Show(System::String ^ text, System::Windows::Forms::IWin32Window ^ window, int x, int y, int duration);
public void Show (string text, System.Windows.Forms.IWin32Window window, int x, int y, int duration);
member this.Show : string * System.Windows.Forms.IWin32Window * int * int * int -> unit
Public Sub Show (text As String, window As IWin32Window, x As Integer, y As Integer, duration As Integer)

参数

text
String String String String

包含新工具提示文本的 StringA String containing the new ToolTip text.

window
IWin32Window IWin32Window IWin32Window IWin32Window

要为其显示工具提示的 ControlThe Control to display the ToolTip for.

x
Int32 Int32 Int32 Int32

用来显示工具提示的水平偏移量(以像素为单位),该偏移量相对于关联控件窗口的左上角。The horizontal offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip.

y
Int32 Int32 Int32 Int32

用来显示工具提示的垂直偏移量(以像素为单位),该偏移量相对于关联控件窗口的左上角。The vertical offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip.

duration
Int32 Int32 Int32 Int32

包含工具提示持续显示时间(以毫秒为单位)的 Int32An Int32 containing the duration, in milliseconds, to display the ToolTip.

异常

window 参数为 nullThe window parameter is null.

注解

此版本的重载Show方法Show(String, IWin32Window, Point, Int32)与版本相同, 不同之处在于, 偏移量指定为单独的 x 和Pointy 坐标, 而不是。This version of the overloaded Show method operates identically to the Show(String, IWin32Window, Point, Int32) version, except that the offset is specified as separate x and y coordinates instead of a Point. 若要以模式方式显示工具提示Show(String, IWin32Window, Int32, Int32) , 请改为调用此方法的重载版本。To display the ToolTip modally, call the Show(String, IWin32Window, Int32, Int32) overloaded version of this method instead.

在部分信任环境中运行的应用AllWindows程序必须断言使用此方法的Show权限, 因为它可控制与用户操作无关的工具提示的显示和位置。Applications running in partial trust must assert the AllWindows permission to use this method, as Show can control the display and location of a ToolTip independent of user action.

安全性

UIPermission
需要AllWindows权限。Requires AllWindows permission.

另请参阅

Show(String, IWin32Window, Point) Show(String, IWin32Window, Point) Show(String, IWin32Window, Point)

设置与指定控件关联的工具提示文本,然后在指定的相对位置以模式方式显示该工具提示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip modally at the specified relative position.

public:
 void Show(System::String ^ text, System::Windows::Forms::IWin32Window ^ window, System::Drawing::Point point);
public void Show (string text, System.Windows.Forms.IWin32Window window, System.Drawing.Point point);
member this.Show : string * System.Windows.Forms.IWin32Window * System.Drawing.Point -> unit

参数

text
String String String String

包含新工具提示文本的 StringA String containing the new ToolTip text.

window
IWin32Window IWin32Window IWin32Window IWin32Window

要为其显示工具提示的 ControlThe Control to display the ToolTip for.

point
Point Point Point Point

包含用来显示工具提示的偏移量(以像素为单位)的 Point,该偏移量相对于关联控件窗口的左上角。A Point containing the offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip.

异常

window 参数为 nullThe window parameter is null.

注解

pt参数可以指定关联控件、其父窗体甚至是桌面边界之外的位置。The pt parameter can specify a position outside the bounds of the associated control, its parent form, or even the desktop. Show方法的版本显示指定控件的工具提示, 即, 在调用Hide方法之前或在父窗体被最小化、隐藏或消除之前, 将显示工具提示。The version of the Show method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the Hide method is called, or until the parent form is minimized, hidden, or dismissed.

在部分信任环境中运行的应用AllWindows程序必须断言使用此方法的Show权限, 因为它可控制与用户操作无关的工具提示的显示和位置。Applications running in partial trust must assert the AllWindows permission to use this method, as Show can control the display and location of a ToolTip independent of user action.

安全性

UIPermission
需要AllWindows权限。Requires AllWindows permission.

另请参阅

Show(String, IWin32Window) Show(String, IWin32Window) Show(String, IWin32Window) Show(String, IWin32Window)

设置与指定控件关联的工具提示文本,然后以模式方式显示工具提示。Sets the ToolTip text associated with the specified control, and displays the ToolTip modally.

public:
 void Show(System::String ^ text, System::Windows::Forms::IWin32Window ^ window);
public void Show (string text, System.Windows.Forms.IWin32Window window);
member this.Show : string * System.Windows.Forms.IWin32Window -> unit
Public Sub Show (text As String, window As IWin32Window)

参数

text
String String String String

包含新工具提示文本的 StringA String containing the new ToolTip text.

window
IWin32Window IWin32Window IWin32Window IWin32Window

要为其显示工具提示的 ControlThe Control to display the ToolTip for.

异常

window 参数为 nullThe window parameter is null.

注解

Show方法的版本显示指定控件的工具提示 (即, 在调用Hide方法之前, 或在父窗体被最小化、隐藏或关闭之前, 将显示工具提示。The version of the Show method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the Hide method is called, or until the parent form is minimized, hidden, or closed. 工具提示位于关联控件的中心。The ToolTip is positioned in the center of the associated control.

在部分信任环境中运行的应用AllWindows程序必须断言使用此方法的Show权限, 因为它可控制与用户操作无关的工具提示的显示和位置。Applications running in partial trust must assert the AllWindows permission to use this method, as Show can control the display and location of a ToolTip independent of user action.

安全性

UIPermission
需要AllWindows权限。Requires AllWindows permission.

另请参阅

Show(String, IWin32Window, Int32) Show(String, IWin32Window, Int32) Show(String, IWin32Window, Int32) Show(String, IWin32Window, Int32)

设置与指定控件关联的工具提示文本,然后在指定时间段内保持该工具提示的显示。Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration.

public:
 void Show(System::String ^ text, System::Windows::Forms::IWin32Window ^ window, int duration);
public void Show (string text, System.Windows.Forms.IWin32Window window, int duration);
member this.Show : string * System.Windows.Forms.IWin32Window * int -> unit
Public Sub Show (text As String, window As IWin32Window, duration As Integer)

参数

text
String String String String

包含新工具提示文本的 StringA String containing the new ToolTip text.

window
IWin32Window IWin32Window IWin32Window IWin32Window

要为其显示工具提示的 ControlThe Control to display the ToolTip for.

duration
Int32 Int32 Int32 Int32

包含工具提示持续显示时间(以毫秒为单位)的 Int32An Int32 containing the duration, in milliseconds, to display the ToolTip.

异常

window 参数为 nullThe window parameter is null.

注解

工具提示位于由win参数表示的关联控件的中心。The ToolTip is positioned in the center of the associated control represented by the win parameter. 若要以模式方式显示工具提示Show(String, IWin32Window) , 请改为调用此方法的重载版本。To display the ToolTip modally, call the Show(String, IWin32Window) overloaded version of this method instead.

在部分信任环境中运行的应用AllWindows程序必须断言使用此方法的Show权限, 因为它可控制与用户操作无关的工具提示的显示和位置。Applications running in partial trust must assert the AllWindows permission to use this method, as Show can control the display and location of a ToolTip independent of user action.

安全性

UIPermission
需要AllWindows权限。Requires AllWindows permission.

另请参阅

适用于