Menu.FindMenuItem(Int32, IntPtr) 方法

定义

获取 MenuItem,它包含指定的值。Gets the MenuItem that contains the value specified.

public:
 System::Windows::Forms::MenuItem ^ FindMenuItem(int type, IntPtr value);
public System.Windows.Forms.MenuItem FindMenuItem (int type, IntPtr value);
member this.FindMenuItem : int * nativeint -> System.Windows.Forms.MenuItem
Public Function FindMenuItem (type As Integer, value As IntPtr) As MenuItem

参数

type
Int32

要用于查找 MenuItem 的项的类型。The type of item to use to find the MenuItem.

value
IntPtr

用于查找 MenuItem 的项。The item to use to find the MenuItem.

返回

匹配值的 MenuItem;否则为 nullThe MenuItem that matches value; otherwise, null.

注解

若要MenuItem使用句柄搜索,请将FindHandle字段作为类型传入,并传入要查找的的MenuItem句柄作为值。To search for a MenuItem using a handle, pass in the FindHandle field as the type, and the handle of the MenuItem you want to find as the value.

若要MenuItem使用快捷方式搜索,请将FindShortcut字段作为类型传入,并将的MenuItem快捷方式值作为值进行传递。To search for a MenuItem using a shortcut, pass in the FindShortcut field as the type, and the Shortcut value for the MenuItem you want to find as the value.

安全性

UIPermission
用于调用此方法的控件。for controls to call this method. 关联的枚举:AllWindowsAssociated enumeration: AllWindows

适用于