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. Visual Basic
  4. Form resize issue

Form resize issue

Scheduled Pinned Locked Moved Visual Basic
helpquestion
7 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.
  • D Offline
    D Offline
    darkturtle
    wrote on last edited by
    #1

    Hi all, New to programing so forgive the basic question. I have created an app with a form that should fill the screen when loaded (its a big 1 screen app by requirement). I am using a 1280 x 1024 screen and I noticed that when I load it on a friends screen that the form window over fills the screen. I guess this is something to do with the different aspect ratios or something. Is there a way that I can make my app window dynamically shrink without lossing any info on the screen- I've tried anchoring the controls and locking them etc but when the parent form is resized they just get cut up. any help or a point in the right direction would be very much appreciated.

    M C 2 Replies Last reply
    0
    • D darkturtle

      Hi all, New to programing so forgive the basic question. I have created an app with a form that should fill the screen when loaded (its a big 1 screen app by requirement). I am using a 1280 x 1024 screen and I noticed that when I load it on a friends screen that the form window over fills the screen. I guess this is something to do with the different aspect ratios or something. Is there a way that I can make my app window dynamically shrink without lossing any info on the screen- I've tried anchoring the controls and locking them etc but when the parent form is resized they just get cut up. any help or a point in the right direction would be very much appreciated.

      M Offline
      M Offline
      Martin Smith
      wrote on last edited by
      #2

      Add a TableLayoutPanel to your form (Dock style: Fill) and then add your original controls to this. You will need to add rows and columns accordingly to accomodate everything but windows will ensure everything is correctly resized when your form changes at runtime. Regards Martin

      D 1 Reply Last reply
      0
      • D darkturtle

        Hi all, New to programing so forgive the basic question. I have created an app with a form that should fill the screen when loaded (its a big 1 screen app by requirement). I am using a 1280 x 1024 screen and I noticed that when I load it on a friends screen that the form window over fills the screen. I guess this is something to do with the different aspect ratios or something. Is there a way that I can make my app window dynamically shrink without lossing any info on the screen- I've tried anchoring the controls and locking them etc but when the parent form is resized they just get cut up. any help or a point in the right direction would be very much appreciated.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Instead of setting a size, set it to maximise on startup. Yes, 1024x768 is a different aspect ratio to every other resolution known to man. But, there are also people with widescreen PCs now, so we can't assume *any* aspect ratio anymore.

        darkturtle wrote:

        I've tried anchoring the controls and locking them etc

        Anchoring or docking them is really the only option apart from writing your own code to position everything.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        D 1 Reply Last reply
        0
        • M Martin Smith

          Add a TableLayoutPanel to your form (Dock style: Fill) and then add your original controls to this. You will need to add rows and columns accordingly to accomodate everything but windows will ensure everything is correctly resized when your form changes at runtime. Regards Martin

          D Offline
          D Offline
          darkturtle
          wrote on last edited by
          #4

          Thanks Martin, Quick question- what is a TableLayoutPanel?? :-) My form consists of a number of controls I have designed myself that are set to a certain size (just are that way because of smallest test box size etc). When I add these to my form the form size fits perfectly in my window. Now when I load it on my friends PC the window is outside of the screen. I would like my form to resize everything (i.e. shrink it all) so that it fits in every windows format. Is this possible and is TableLayoutPanel the way to do it (I've looked on MSDN and cannot find a reference for it) Thanks very much for the reply.

          M 1 Reply Last reply
          0
          • C Christian Graus

            Instead of setting a size, set it to maximise on startup. Yes, 1024x768 is a different aspect ratio to every other resolution known to man. But, there are also people with widescreen PCs now, so we can't assume *any* aspect ratio anymore.

            darkturtle wrote:

            I've tried anchoring the controls and locking them etc

            Anchoring or docking them is really the only option apart from writing your own code to position everything.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

            D Offline
            D Offline
            darkturtle
            wrote on last edited by
            #5

            Christian, Thanks for the reply- 1024 x 768 is perfect for engineering work!!! But obviously is causing problems with my program. When I maximise on start up I still have the same problem- the form controls (my own designed controls) fit into my window but in my friends they get pushed together and overlap making them illegible. Do you know of anyway to shink them to size??? On my screen they are perfect size but on my friends they look huge!!! thanks for any help.

            C 1 Reply Last reply
            0
            • D darkturtle

              Christian, Thanks for the reply- 1024 x 768 is perfect for engineering work!!! But obviously is causing problems with my program. When I maximise on start up I still have the same problem- the form controls (my own designed controls) fit into my window but in my friends they get pushed together and overlap making them illegible. Do you know of anyway to shink them to size??? On my screen they are perfect size but on my friends they look huge!!! thanks for any help.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              I use anchor for this all the time, it works a treat for me. From time to time, I've written code to manually move things, but rarely.

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

              1 Reply Last reply
              0
              • D darkturtle

                Thanks Martin, Quick question- what is a TableLayoutPanel?? :-) My form consists of a number of controls I have designed myself that are set to a certain size (just are that way because of smallest test box size etc). When I add these to my form the form size fits perfectly in my window. Now when I load it on my friends PC the window is outside of the screen. I would like my form to resize everything (i.e. shrink it all) so that it fits in every windows format. Is this possible and is TableLayoutPanel the way to do it (I've looked on MSDN and cannot find a reference for it) Thanks very much for the reply.

                M Offline
                M Offline
                Martin Smith
                wrote on last edited by
                #7

                Hi, The TableLayoutPanel (I'm using VS2005 Pro, so I've assumed you are using it too, and hoping you have access to this form control!!) is in the "Toolbox" (i.e. where you find labels and textboxes and the like) under the "Containers" section. It works like a spreadsheet with rows and columns. What you need to do is dock your controls within the TableLayoutPanels cells (its obvious once youve dragged one onto your form).... Also reading this thread, Are some problems related to the size of the operating system font (i.e. Display Settings->Advanced === By default this will be "Normal". Perhaps your friends PC is set to Large or Extra Large) Regards, Martin

                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