Just purchased telerik and in the process of converting winforms to teleriks components.
I started off with the error of "Value of type 'Telerik.WinControls.RadItem' cannot be converted to 'System.Windows.Forms.ToolStripMenuItem'". So I changed all ToolStripMenuItem to "RadMenuItem". This solved the above error.
But created a new error "Private Sub AddMenuChildren(ByRef mi As Telerik.WinControls.UI.RadMenuItem)' and 'Private Sub AddMenuChildren(mi As Telerik.WinControls.UI.RadMenuItem)' cannot overload each other because they differ only by parameters declared 'ByRef' or 'ByVal'"
Any Help with the above error would be appreciated.
Below is my code:
Private Sub LockMain()
'This subroutine handles the locking of the Main windows'
' menu options and child windows. It first iterates
' through all menu control collection items disabling
' them. It then iterates through all the machine
' windows disabling them. It then enables a select few
' menu options.
For i = 1 To mcc.Count
CType(mcc.Item(i), ToolStripMenuItem).Enabled = False
Next
'If mwa IsNot Nothing Then
' For Each m As Machine In mwa
' m.Enabled = False
' Next
'End If
LogONOFFToolStripMenuItem.Enabled = True
LogOnToolStripMenuItem.Enabled = True
HelpToolStripMenuItem.Enabled = True
AboutToolStripMenuItem.Enabled = True
ViewManualToolStripMenuItem.Enabled = True
End Sub
Private Sub UnlockPermissions()
Dim sp As New SecurityProfile_(mcn, ud(4))
For Each i As ToolStripMenuItem In mcc
If sp.GetProperty(i.Text) Then
i.Enabled = True
End If
Next
For Each m As Machine In mwl
m.Enabled = True
Next
End Sub
Private Sub CreateMenuControlCollection()
For Each mi As ToolStripMenuItem In MenuStrip1.Items
mcc.Add(mi, mi.Text)
AddMenuChildren(mi)
Next
End Sub
Private Sub AddMenuChildren(ByRef mi As ToolStripMenuItem)
If mi.DropDownItems IsNot Nothing Then
For Each c As Object In mi.DropDownItems
Dim mc As ToolStripMenuItem = TryCast(c, ToolStripMenuItem)
If mc IsNot Nothing Then
mcc.Add(mc, mc.Text)
AddMenuChildren(mc)
End If
Next
End If
End Sub