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. Resize Control

Resize Control

Scheduled Pinned Locked Moved C#
questiondebugginghelpannouncement
13 Posts 6 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.
  • A Offline
    A Offline
    AmbiguousName
    wrote on last edited by
    #1

    Hello. I have started a process using Process.Start. Now when I resize my panel, I also resize this control. But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border. So question is why can not I resize my external program along with panel, just like I resize my panel along with form? Thanks for any pointer. UPDATE I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code

    private void Form1_SizeChanged(object sender, EventArgs e)
    {
    // "panel1" is docked to TOP
    SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
    }

    I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?

    This world is going to explode due to international politics, SOON.

    B OriginalGriffO L D 5 Replies Last reply
    0
    • A AmbiguousName

      Hello. I have started a process using Process.Start. Now when I resize my panel, I also resize this control. But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border. So question is why can not I resize my external program along with panel, just like I resize my panel along with form? Thanks for any pointer. UPDATE I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code

      private void Form1_SizeChanged(object sender, EventArgs e)
      {
      // "panel1" is docked to TOP
      SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
      }

      I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?

      This world is going to explode due to international politics, SOON.

      B Offline
      B Offline
      BillWoodruff
      wrote on last edited by
      #2

      I note you use the word 'Control to describe what you are working with, but using Process.Start runs an Application that then puts up a window(s). 1. what is the Application you start using Process.Start ? 2. what are you doing to make that Application's Window(s) a child Control of the Panel (added to the Panel's ControlCollection) ? or, is it (more likely), that the application window is not a child of the Panel ? 3. is it possible that whatever application you start's window has a fixed window size maximum ? 4. if you make the Panel size smaller: what happens to the hosted whatever ? More specific details, please.

      « I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant

      A R 2 Replies Last reply
      0
      • A AmbiguousName

        Hello. I have started a process using Process.Start. Now when I resize my panel, I also resize this control. But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border. So question is why can not I resize my external program along with panel, just like I resize my panel along with form? Thanks for any pointer. UPDATE I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code

        private void Form1_SizeChanged(object sender, EventArgs e)
        {
        // "panel1" is docked to TOP
        SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
        }

        I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?

        This world is going to explode due to international politics, SOON.

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        This is not a good question - we cannot work out from that little what you are trying to do. Remember that we can't see your screen, access your HDD, or read your mind. Edit your question and provide better information.

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        A 1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          This is not a good question - we cannot work out from that little what you are trying to do. Remember that we can't see your screen, access your HDD, or read your mind. Edit your question and provide better information.

          Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

          A Offline
          A Offline
          AmbiguousName
          wrote on last edited by
          #4

          I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code

          private void Form1_SizeChanged(object sender, EventArgs e)
          {
          // "panel1" is docked to TOP
          SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
          }

          I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?

          This world is going to explode due to international politics, SOON.

          1 Reply Last reply
          0
          • B BillWoodruff

            I note you use the word 'Control to describe what you are working with, but using Process.Start runs an Application that then puts up a window(s). 1. what is the Application you start using Process.Start ? 2. what are you doing to make that Application's Window(s) a child Control of the Panel (added to the Panel's ControlCollection) ? or, is it (more likely), that the application window is not a child of the Panel ? 3. is it possible that whatever application you start's window has a fixed window size maximum ? 4. if you make the Panel size smaller: what happens to the hosted whatever ? More specific details, please.

            « I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant

            A Offline
            A Offline
            AmbiguousName
            wrote on last edited by
            #5

            1 - I am hosting media player classic. I start this application using Process.Start. 2 - Don't know what to say. 3 - NO 4 - nothing

            This world is going to explode due to international politics, SOON.

            1 Reply Last reply
            0
            • B BillWoodruff

              I note you use the word 'Control to describe what you are working with, but using Process.Start runs an Application that then puts up a window(s). 1. what is the Application you start using Process.Start ? 2. what are you doing to make that Application's Window(s) a child Control of the Panel (added to the Panel's ControlCollection) ? or, is it (more likely), that the application window is not a child of the Panel ? 3. is it possible that whatever application you start's window has a fixed window size maximum ? 4. if you make the Panel size smaller: what happens to the hosted whatever ? More specific details, please.

              « I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant

              R Offline
              R Offline
              Rob Philpott
              wrote on last edited by
              #6

              I'd be interested in the answer to 2. Dark magic, perhaps.

              Regards, Rob Philpott.

              B 1 Reply Last reply
              0
              • A AmbiguousName

                Hello. I have started a process using Process.Start. Now when I resize my panel, I also resize this control. But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border. So question is why can not I resize my external program along with panel, just like I resize my panel along with form? Thanks for any pointer. UPDATE I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code

                private void Form1_SizeChanged(object sender, EventArgs e)
                {
                // "panel1" is docked to TOP
                SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
                }

                I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?

                This world is going to explode due to international politics, SOON.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                AmbiguousName wrote:

                But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border.

                That is a bit confusing, does it resize or does it not? Is this window a child of your panel (i.e. how are you hosting it) or are you just positioning it above your panel?

                A 1 Reply Last reply
                0
                • R Rob Philpott

                  I'd be interested in the answer to 2. Dark magic, perhaps.

                  Regards, Rob Philpott.

                  B Offline
                  B Offline
                  BillWoodruff
                  wrote on last edited by
                  #8

                  Rob Philpott wrote:

                  I'd be interested in the answer to 2.

                  [^] ? [^] ? Hi Rob, My understanding is that some applications are designed to be "embeddable" ... like Mozilla, IE. In this case we don't know what app the OP wants to launch, or even if he needs it to be "embedded." cheers, Bill

                  « I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant

                  R 1 Reply Last reply
                  0
                  • L Lost User

                    AmbiguousName wrote:

                    But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border.

                    That is a bit confusing, does it resize or does it not? Is this window a child of your panel (i.e. how are you hosting it) or are you just positioning it above your panel?

                    A Offline
                    A Offline
                    AmbiguousName
                    wrote on last edited by
                    #9

                    Please read my updated question. As I said there, breakpoint gets hit which means that I can not go on and continue resizing my form.

                    This world is going to explode due to international politics, SOON.

                    L 1 Reply Last reply
                    0
                    • B BillWoodruff

                      Rob Philpott wrote:

                      I'd be interested in the answer to 2.

                      [^] ? [^] ? Hi Rob, My understanding is that some applications are designed to be "embeddable" ... like Mozilla, IE. In this case we don't know what app the OP wants to launch, or even if he needs it to be "embedded." cheers, Bill

                      « I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant

                      R Offline
                      R Offline
                      Rob Philpott
                      wrote on last edited by
                      #10

                      Interesting. I'll have a look at that later on. My thinking is its a protected operating system so the idea of borrowing a windows handle from one process and incorporating into the hierarchy in another would be strictly unavailable. But, as one other comment points out, what about OLE?. More thought/research required. [Edit] - even if possible somehow, it sounds like a dreadful idea.

                      Regards, Rob Philpott.

                      1 Reply Last reply
                      0
                      • A AmbiguousName

                        Hello. I have started a process using Process.Start. Now when I resize my panel, I also resize this control. But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border. So question is why can not I resize my external program along with panel, just like I resize my panel along with form? Thanks for any pointer. UPDATE I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code

                        private void Form1_SizeChanged(object sender, EventArgs e)
                        {
                        // "panel1" is docked to TOP
                        SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
                        }

                        I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?

                        This world is going to explode due to international politics, SOON.

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #11

                        First, that other process is not a "control". It's a foreign process "window". You cannot use the two terms interchangeably as this will confuse people. Second, I already told you what you're doing is very difficult to control and you will not have complete control over the foreign process window. Users CAN and WILL manipulate that window just like it was sitting on the Desktop outside of your application. For example, they WILL be able to grab the window title bar and window edges and move them around. They can even minimize and maximize the window without your application knowing anything about it! What you're doing is possible to do, but not in a production application. It's more of a novelty than anything else.

                        A guide to posting questions on CodeProject

                        Click this: Asking questions is a skill. Seriously, do it.
                        Dave Kreskowiak

                        1 Reply Last reply
                        0
                        • A AmbiguousName

                          Please read my updated question. As I said there, breakpoint gets hit which means that I can not go on and continue resizing my form.

                          This world is going to explode due to international politics, SOON.

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #12

                          AmbiguousName wrote:

                          breakpoint gets hit which means that I can not go on and continue resizing my form.

                          That is as to be expected, but does not add to the information you have been asked to provide.

                          1 Reply Last reply
                          0
                          • A AmbiguousName

                            Hello. I have started a process using Process.Start. Now when I resize my panel, I also resize this control. But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border. So question is why can not I resize my external program along with panel, just like I resize my panel along with form? Thanks for any pointer. UPDATE I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code

                            private void Form1_SizeChanged(object sender, EventArgs e)
                            {
                            // "panel1" is docked to TOP
                            SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
                            }

                            I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?

                            This world is going to explode due to international politics, SOON.

                            B Offline
                            B Offline
                            BillWoodruff
                            wrote on last edited by
                            #13

                            Now that we finally know you are using the Win Media Player ... check out: [^]. cheers, Bill

                            « I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant

                            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