C# と VB.NET の質問掲示板

わんくま同盟

ASP.NET、C++/CLI、Java 何でもどうぞ

C# と VB.NET の入門サイト


(過去ログ 103 を表示中)
■61228 / )  Re[1]: タスクトレイにNotePadを登録
□投稿者/ とっとと (2回)-(2011/08/06(Sat) 11:26:59)
コードです。

    Private Sub NotifyIcon1_MouseDown( _
        ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
        Handles NotifyIcon1.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Left Then
            ' マウス左ボタンをクリック
            If exe Is Nothing = False AndAlso exe.MainWindowHandle <> 0 Then
                If IsWindowVisible(exe.MainWindowHandle) = 0 Then
                    ' ウィンドウ表示
                    ShowWindow(exe.MainWindowHandle, SW_SHOW)
                Else
                    ' ウィンドウ非表示
                    ShowWindow(exe.MainWindowHandle, SW_HIDE)
                End If
            End If
        End If
        If e.Button = Windows.Forms.MouseButtons.Right Then
            If MsgBox("終了します!", vbQuestion + vbOKCancel + vbDefaultButton2, "確認") = vbCancel Then Exit Sub
            Me.Close()
        End If  
    End Sub

返信 編集キー/


管理者用

- Child Tree -