I need some help from the IT gurus on this forum. I'm having trouble with my MS Windows menu's Edit menu item. What I'm trying to do is enable or disable the Cut menu item depending on whether the selectionlength of my textbox's text is zero or greater than zero. But my code below doesn't work. Any ideas how to solve this? Thanks for reading my post!
<MenuItem Click="mnuedit_Click" FontSize="12" Foreground="Black" Header="Edit" Name="mnuedit">
<MenuItem Click="mnucut_Click" FontSize="12" Foreground="Black" Header="Cut" IsEnabled="False" Name="mnucut"/>
</MenuItem>
Private Sub mnuedit_Click(sender As Object, e As RoutedEventArgs)
If txtnote.SelectionLength = 0 Then
mnucut.IsEnabled = False
ElseIf txtnote.SelectionLength >= 1 Then
mnucut.IsEnabled = True
End If
End Sub