Link to home
Start Free TrialLog in
Avatar of Vyyk_Drago
Vyyk_Drago

asked on

Help with converting C# code to VB .NET

Hi,

Iam learning wpf using vb.net and am working through a tutorial on the Ribobn control UI element.  I have the turorial here but the code here is in C#.

http://www.uxpassion.com/2008/11/how-to-use-add-ribbon-to-wpf-applications-part-3/

Can someone please help me on how to implement this small bit using VB.NET - this is what I have so far, but I keep getting the error saying OnCanExecute is not member of testapp.testapp.Window1.

Any help will be much appreciated.

Thanks
V
Imports System
Imports System.IO
Imports System.Net
Imports System.Windows
Imports System.Windows.Controls
Imports Microsoft.Windows.Controls.Ribbon
Imports System.Windows.Data
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Navigation
Imports System.Collections.ObjectModel

Imports System.Windows.Input


Class Window1

    Private Sub OnCanExecute(ByVal target As Object, ByVal args As CanExecuteRoutedEventArgs)

    End Sub

End Class

Open in new window

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Where are you getting that error?  

OnCanExecute is a private method, and not accessible outside of the Window1 class:

     Private Sub OnCanExecute
ASKER CERTIFIED SOLUTION
Avatar of nandithaa
nandithaa
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Vyyk_Drago
Vyyk_Drago

ASKER

Hi nandithaa,

That works excellently except for a small typo where

Private Sub OnShowClipboardGroup(ByVal target As Object, ByVal args As CanExecuteRoutedEventArgs)

should probably read

Private Sub ListGlobalNamesCommand(ByVal target As Object, ByVal args As ExecutedRoutedEventArgs)

Much appreciated :)
Thanks
V

Small typo, but on the whole very clear and useful.
Thanks :)