FormBorderStyle.None & Taskbar Click

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kaem86
    New Member
    • Apr 2012
    • 3

    FormBorderStyle.None & Taskbar Click

    Hi,

    I changed FormBorderStyle to FormBorderStyle .None, now when I click on taskbar nothing happen, but window should minimalized/back to normal state.

    Any ideas how to solve it?

    I'm using Win XP.

    - kaem86
  • RhysW
    New Member
    • Mar 2012
    • 70

    #2
    this isnt a problem with your system its the way its set up to work, it wont minimise or anything when you have its border style set to none, can i ask why you are trying to do this?
    presumeably because you dont want the user to be able to close the form?
    i don't suggest ever trying to stop it but there is a work around, use a fixeddialog state in the borderstyle to keep it to its set size and in the formclosing event you can set the code to e.cancel = true and it should stop the form from closing but again, i dont suggest you ever try to restrict the user

    Maybe a little more explanation on what you want to be able achieve would be nice :)

    Comment

    • kaem86
      New Member
      • Apr 2012
      • 3

      #3
      Sure :)

      I wan't use own buttons (min, max, exit, more), so i set FormBorderStyle to FormBorderStyle .None and writed my code to paint window on my way (with my buttons). Buttons are working fine (min, max), but only this effect is annoying. I need something like that (or this code to run automatic):

      Code:
      void TaskBarClick()
      {
          if(this.WindowState != FormWindowState.Minimized)
          {
              prevstate = this.WindowState;
              this.WindowState = FormWindowState.Minimized;
          }
          else this.WindowState = prevstate;
      }
      For example photoshop have own window style and for this it works fine (clicking on taskbar).

      Comment

      • RhysW
        New Member
        • Mar 2012
        • 70

        #4
        Ok so i searched about for a bit and found this, it might be of use to you its doing pretty much what you're asking for something to do!

        It's for someone else's code but hopefully you will be able to transfer the knowledge into your own code the following
        Link should point you in the right direction!

        Comment

        • kaem86
          New Member
          • Apr 2012
          • 3

          #5
          It's exacly what i needed, thank you :)

          Comment

          Working...