The application for some reason does not want to fold when clicking on the icon in the taskbar. For example, I took VS :

taskbar icon

Has anyone encountered such a problem? Tell me, please, how to fix it?

  • To begin with, who told you that VS is written in C # - Dmitry Gvozd
  • A question to clarify, are you talking about the program you are writing or about some other program? - Dmitry Gvozd
  • And then the tag icon? - Dmitry Gvozd
  • I wrote a simple application on WinForm, and when you click on the icon on the taskbar, the program does not collapse or unfold. I have already noted that VS is for example. - dexploizer
  • This is the basic functionality of the Explorer, which should work if you do not break it. - Pavel Mayorov

1 answer 1

Nothing broke. It was just with FormBorderStyle: None . Add to the form:

 const int WS_MINIMIZEBOX = 0x20000; const int CS_DBLCLKS = 0x8; protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.Style |= WS_MINIMIZEBOX; cp.ClassStyle |= CS_DBLCLKS; return cp; } } 

Original answer: https://stackoverflow.com/a/5180893/7099599

  • one
    Thank you very much! - dexploizer