Link Button - Windows ApplicationC# Signatu

Hi,

How can I make a link button minimize a applicationto taskbar And from the taskbar maximize

Thanks




Answer this question

Link Button - Windows ApplicationC# Signatu

  • jkonair

    Yes....like the default minimize button...



  • David Gutierrez

    minimize and lose the focus


  • softer

    Thanks you zapacila89, i will mark your posts to!

  • mks033

    Hi ZopoStyle,
    The .NET way to do this is simple:

    this.WindowState = FormWindowState.Minimized;

    Hope that helps,
    Thi

  • Dan_TGT

    C# Signature:

    [DllImport("user32.dll")]
    static extern bool CloseWindow(IntPtr hWnd);

    The CloseWindow function minimizes (but does not destroy) the specified window.

    To destroy a window, an application must use the DestroyWindow function.



    Hope This helps




  • MS Johan Stenberg

    PJ. van de Sande gived you the 100% answer.. so Have Luck and happy Coding


  • Karen Mae Sapla

    This isd the real answe thanks

  • MVPE

    But this only works for you own application and you can't minimize other applications.


  • deviao9

    As zapacila89 says, you can use the CloseWindow method with p/invoke. This method is located in the user32.dll so it will be availabe.
    This works from Wndows 95 and Windows NT 3.1.

    The method returns a true when if succeeds; otherwise it will return false and you can get the error information with the GetLastError method. But never use GetLastError method with p/invoke but use the GetLastWin32Error method of the Marshal class.

    Here is a little example:

    [DllImport("user32.dll")]
    static extern bool CloseWindow(IntPtr hWnd);

    private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
    CloseWindow( this.Handle );
    }




  • myso77

    hmm do how ever you want..

    me and PJ. van de Sande gived you the universal answer...


  • Dishan Fernando

    ya guess this should work...


  • Raghavendra RAV

    So,

    I just need to import the dll and put CloseWindow(GetForeGroundWindow()); in the lnkbutton event



  • Link Button - Windows ApplicationC# Signatu