Menu.MenuItemCollection.Find(String, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
查找具有指定键的项,可以选择搜索子菜单项。
public:
cli::array <System::Windows::Forms::MenuItem ^> ^ Find(System::String ^ key, bool searchAllChildren);
public System.Windows.Forms.MenuItem[] Find(string key, bool searchAllChildren);
member this.Find : string * bool -> System.Windows.Forms.MenuItem[]
Public Function Find (key As String, searchAllChildren As Boolean) As MenuItem()
参数
- key
- String
要搜索的菜单项的名称。
- searchAllChildren
- Boolean
true 搜索子菜单项;否则,为 false.
返回
MenuItem[]
其Name属性与指定的key对象匹配的对象数组MenuItem。
例外
key 是 null 或空字符串。
注解
关键比较不区分大小写。
key如果参数为null空字符串或没有匹配项,Find则返回空数组。
该 Name 属性对应于中某个 MenuItem 项的 Menu.MenuItemCollection键。