[英]rad menu , check if item text exists
使用telerik和radmenu,您知道如何通過文本檢查項目是否存在
我的菜單包含文本“ menu1”
如果我使用menu.FindItemByText("menu1").Enabled = False
則將禁用該按鈕
但
如果我使用menu.FindItemByText("menuTEST").Enabled = False
那么我將收到一個異常,因為此按鈕不存在。
如何停止錯誤?
我在下面嘗試了這個但是它說它不能返回booloen
If menu.FindItemByText("menuTEST") then
'do this
End If
嘗試這個:
If Not(menu.FindItemByText("menuTEST") Is Nothing) then
'do this
End If
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.