Переписать код работы с NotifyIcon (WPF, C#) на VB.NET - Visual Basic .NET

Узнай цену своей работы

Формулировка задачи:

Привет!!! помогите перевести программу на С# в VB.NET:
Вот что я сам смог на переводить:
<<Заранее благодарен.>>

Решение задачи: «Переписать код работы с NotifyIcon (WPF, C#) на VB.NET»

textual
Листинг программы
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
Imports System.Drawing
Imports System.Windows.Forms
Namespace WpfApplication1
    ''' <summary>
    ''' Логика взаимодействия для MainWindow.xaml
    ''' </summary>
    Public Partial Class MainWindow
        Inherits Window
        Public Sub New()
            InitializeComponent()
        End Sub
        Protected notifyicon As NotifyIcon
        Private Sub button1_Click(sender As Object, e As RoutedEventArgs)
            notifyicon = New System.Windows.Forms.NotifyIcon()
            notifyicon.Icon = New System.Drawing.Icon("Bulb.ico")
            notifyicon.Visible = True
            AddHandler notifyicon.MouseClick, New System.Windows.Forms.MouseEventHandler(AddressOf notifyicon_Click)
            notifyicon.ShowBalloonTip(500, "Ich bin im Trey", "Ich bin eine Notifyicon", System.Windows.Forms.ToolTipIcon.Info)
 
            Dim notinfyiconContextMenu As New System.Windows.Forms.ContextMenu()
            notinfyiconContextMenu.MenuItems.Add("Offnen", New EventHandler(AddressOf Open))
            notinfyiconContextMenu.MenuItems.Add("Beenden", New EventHandler(AddressOf Close))
 
            notifyicon.ContextMenu = notinfyiconContextMenu
        End Sub
        Private Sub Open(sender As Object, e As EventArgs)
            System.Windows.Forms.MessageBox.Show("Offnen")
        End Sub
        Private Sub Close(sender As Object, e As EventArgs)
            System.Windows.Forms.MessageBox.Show("Beenden")
        End Sub
        Private Sub notifyicon_Click(sender As Object, e As System.Windows.Forms.MouseEventArgs)
            If e.Button = System.Windows.Forms.MouseButtons.Left Then
                System.Windows.Forms.MessageBox.Show("Linke Maustaste gerduckt")
            End If
        End Sub
    End Class
End Namespace

Оцени полезность:

13   голосов , оценка 4.077 из 5
Похожие ответы