Hi Paul
You are right, your latest works like a charm. I actually took what you had given me earlier and found the following works as well.
Imports System.Runtime.InteropServ
ices
Imports System.Text
Public Class Form1
_
Private Shared Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As Int32) As Boolean
End Function
Private Const SW_MINIMIZED As Integer = 6
Private Sub Minimize()
' The Taskbar must be enabled to be able to do a Smart Minimize
Me.FormBorderStyle = FormBorderStyle.FixedDialog
Me.WindowState = FormWindowState.Normal
Me.ControlBox = True
Me.MinimizeBox = True
Me.MaximizeBox = True
' Since there is no WindowState.Minimize, we have to P/Invoke ShowWindow
ShowWindow(Me.Handle, SW_MINIMIZED)
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Application.Exit()
End Sub
Private Sub btnMinimize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMinimize.Click 'we use this as our close button
Minimize()
End Sub
End Class