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. .NET (Core and Framework)
  4. For minimizing and maximizing

For minimizing and maximizing

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpquestion
6 Posts 3 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.
  • R Offline
    R Offline
    Robert Rohde
    wrote on last edited by
    #1

    Hi, I have a strange problem. Hopefully someone can help me here. I have a Form (lets call it FormA) where I execute the following code:

    FormB f = new FormB();
    f.ShowInTaskbar = false;
    f.Owner = this;
    f.Show();

    Now I have a form (the standard Sizable one) which always hangs over FormA. I can resize, minimize and maximize it normally. But when FormB is maximized and then minimize and restore FormA then Form B isn't maximized anymore. It also gets restored to a normal size which I don't want to happen. Any ideas?

    _ G 2 Replies Last reply
    0
    • R Robert Rohde

      Hi, I have a strange problem. Hopefully someone can help me here. I have a Form (lets call it FormA) where I execute the following code:

      FormB f = new FormB();
      f.ShowInTaskbar = false;
      f.Owner = this;
      f.Show();

      Now I have a form (the standard Sizable one) which always hangs over FormA. I can resize, minimize and maximize it normally. But when FormB is maximized and then minimize and restore FormA then Form B isn't maximized anymore. It also gets restored to a normal size which I don't want to happen. Any ideas?

      _ Offline
      _ Offline
      _alank
      wrote on last edited by
      #2

      Likely you may actually be creating a new copy of FormB rather then restoring the original copy. You could verify this by removing or commenting out the f.ShowInTaskbar entry. Later :)

      R 1 Reply Last reply
      0
      • _ _alank

        Likely you may actually be creating a new copy of FormB rather then restoring the original copy. You could verify this by removing or commenting out the f.ShowInTaskbar entry. Later :)

        R Offline
        R Offline
        Robert Rohde
        wrote on last edited by
        #3

        Let me clarify this. I'm not restoring anything... The situation is that FormA is maximized on on monitor. Then FormB is created and maximized on the other monitor (by the user). If the user clicks on the minimize button of FormA than both forms are minimized. So far so good. If the user reactivates FormA then FormA gets restored to full size but not FormB.

        1 Reply Last reply
        0
        • R Robert Rohde

          Hi, I have a strange problem. Hopefully someone can help me here. I have a Form (lets call it FormA) where I execute the following code:

          FormB f = new FormB();
          f.ShowInTaskbar = false;
          f.Owner = this;
          f.Show();

          Now I have a form (the standard Sizable one) which always hangs over FormA. I can resize, minimize and maximize it normally. But when FormB is maximized and then minimize and restore FormA then Form B isn't maximized anymore. It also gets restored to a normal size which I don't want to happen. Any ideas?

          G Offline
          G Offline
          Graham Nimbley
          wrote on last edited by
          #4

          Surely you can't reference yourself in f.Owner. Form.Owner sets a reference to another Form which owns it. Top-level forms can't have an owner, which is what I'm assume you are doing by referencing yourself. I'm could be wrong though! Graham. -- modified at 19:31 Tuesday 25th April, 2006 On further research, when a parent form is minimized or maximized is also minimizes or maximizes it's owned forms. This would account for your code hanging as it's getting into an infinite loop due to f.Owner.

          R 1 Reply Last reply
          0
          • G Graham Nimbley

            Surely you can't reference yourself in f.Owner. Form.Owner sets a reference to another Form which owns it. Top-level forms can't have an owner, which is what I'm assume you are doing by referencing yourself. I'm could be wrong though! Graham. -- modified at 19:31 Tuesday 25th April, 2006 On further research, when a parent form is minimized or maximized is also minimizes or maximizes it's owned forms. This would account for your code hanging as it's getting into an infinite loop due to f.Owner.

            R Offline
            R Offline
            Robert Rohde
            wrote on last edited by
            #5

            Have a closer look at my code. It resides in FormA (which is this) and sets itself to a brand new instance of FormB. So no self referencing and also no hanging or infinite loop.

            G 1 Reply Last reply
            0
            • R Robert Rohde

              Have a closer look at my code. It resides in FormA (which is this) and sets itself to a brand new instance of FormB. So no self referencing and also no hanging or infinite loop.

              G Offline
              G Offline
              Graham Nimbley
              wrote on last edited by
              #6

              Opps... :-O Misread your code!

              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