Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Event when window is minimizex/maximized

Event when window is minimizex/maximized

Scheduled Pinned Locked Moved C#
question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Imtiaz Murtaza
    wrote on last edited by
    #1

    Friends, How do i handle the event when window is minimized to the taskbar by clicking the minimize button. Also i want to handle the event when user clicks taskbar button to maximize it. I cant find these events in events window.

    Imtiaz

    A Q B 3 Replies Last reply
    0
    • I Imtiaz Murtaza

      Friends, How do i handle the event when window is minimized to the taskbar by clicking the minimize button. Also i want to handle the event when user clicks taskbar button to maximize it. I cant find these events in events window.

      Imtiaz

      A Offline
      A Offline
      AB7771
      wrote on last edited by
      #2

      You have to use the Activated event and in that check the windowstate of the form. Hope that works for u...

      Thanks & Regards, Pramod "Everyone is a genius at least once a year"

      Q 1 Reply Last reply
      0
      • I Imtiaz Murtaza

        Friends, How do i handle the event when window is minimized to the taskbar by clicking the minimize button. Also i want to handle the event when user clicks taskbar button to maximize it. I cant find these events in events window.

        Imtiaz

        Q Offline
        Q Offline
        quiteSmart
        wrote on last edited by
        #3

        hi, I think you shuld use the sizeChanged event which is fired whenever the size of the form changes. in the sizeChanged event you should add the following code if(this.Size == this.MaximumSize) //....Do the following, the form is maximized if(this.Size == this.MinimumSize) //.... DO he following, the form is minimized good luck

        1 Reply Last reply
        0
        • A AB7771

          You have to use the Activated event and in that check the windowstate of the form. Hope that works for u...

          Thanks & Regards, Pramod "Everyone is a genius at least once a year"

          Q Offline
          Q Offline
          quiteSmart
          wrote on last edited by
          #4

          hi this wont work cz it is only fired when the form comes to the active mode from the inactive mode which is not the case here.

          1 Reply Last reply
          0
          • I Imtiaz Murtaza

            Friends, How do i handle the event when window is minimized to the taskbar by clicking the minimize button. Also i want to handle the event when user clicks taskbar button to maximize it. I cant find these events in events window.

            Imtiaz

            B Offline
            B Offline
            Bhupi Bhai
            wrote on last edited by
            #5

            The shortest way to do is : In the Form Resize event check for "FormWindowState". Eg: private void Form1_Resize(object sender, System.EventArgs e) { if (FormWindowState.Minimized == WindowState) { //Your code .. } } Regards, Bhupi Bhai.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups