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. How to resise controls when maximising the C# Application?

How to resise controls when maximising the C# Application?

Scheduled Pinned Locked Moved C#
questioncsharptutorial
7 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.
  • P Offline
    P Offline
    pubududilena
    wrote on last edited by
    #1

    hi all, I have done a C# Applcation with TextBoxes,Labels and DataGrid.Default Window State of the Form is "Normal". Now I want to resise Controls in the Window Form when maximising the Dialog.. How can I do it?if any one knows it ,please reply me.. thanks in advance..

    G M 2 Replies Last reply
    0
    • P pubududilena

      hi all, I have done a C# Applcation with TextBoxes,Labels and DataGrid.Default Window State of the Form is "Normal". Now I want to resise Controls in the Window Form when maximising the Dialog.. How can I do it?if any one knows it ,please reply me.. thanks in advance..

      G Offline
      G Offline
      gaby2r
      wrote on last edited by
      #2

      you can use the Anchor propriety of the controls to a certain degree. For example if you have a control Anchored to a margine, whenever that margine is moved the control will always keep the same distance from that margine. if the control is Anchored to two oposed Margines(left and right for example), when the parent control is resized, the control will increase his size acordingly so as to keep the same distances from the margins(in the left right case he will increase his width). Anchors work in desing mode too .. you should try and experimet with them there. if you want more control you can handle the SizeChanged event of the parent control (this beeing in your case the main form).

      P 1 Reply Last reply
      0
      • G gaby2r

        you can use the Anchor propriety of the controls to a certain degree. For example if you have a control Anchored to a margine, whenever that margine is moved the control will always keep the same distance from that margine. if the control is Anchored to two oposed Margines(left and right for example), when the parent control is resized, the control will increase his size acordingly so as to keep the same distances from the margins(in the left right case he will increase his width). Anchors work in desing mode too .. you should try and experimet with them there. if you want more control you can handle the SizeChanged event of the parent control (this beeing in your case the main form).

        P Offline
        P Offline
        pubududilena
        wrote on last edited by
        #3

        Thanks for reply.. This Method is work successfully if one control in the Windows Form. How is this implement to WindowForm exist with many Controls..?

        C 1 Reply Last reply
        0
        • P pubududilena

          Thanks for reply.. This Method is work successfully if one control in the Windows Form. How is this implement to WindowForm exist with many Controls..?

          C Offline
          C Offline
          Claudio Grazioli
          wrote on last edited by
          #4

          It works with many controls as well. If you do it right. What does not work? Claudio Claudio's Website Hommingberger Gepardenforelle

          P 1 Reply Last reply
          0
          • P pubududilena

            hi all, I have done a C# Applcation with TextBoxes,Labels and DataGrid.Default Window State of the Form is "Normal". Now I want to resise Controls in the Window Form when maximising the Dialog.. How can I do it?if any one knows it ,please reply me.. thanks in advance..

            M Offline
            M Offline
            MoustafaS
            wrote on last edited by
            #5

            If you are using teh visual studio IDE it's simple by only holdig Control key while clicking the con trols you want to set it's auncher property,and then set the directions you want this control to be auncher to.

            1 Reply Last reply
            0
            • C Claudio Grazioli

              It works with many controls as well. If you do it right. What does not work? Claudio Claudio's Website Hommingberger Gepardenforelle

              P Offline
              P Offline
              pubududilena
              wrote on last edited by
              #6

              hi if we add many controls to the Application,and do Anchor for all controls,after that maximising several times, some controls are going to invisible. that's the problem.

              C 1 Reply Last reply
              0
              • P pubududilena

                hi if we add many controls to the Application,and do Anchor for all controls,after that maximising several times, some controls are going to invisible. that's the problem.

                C Offline
                C Offline
                Claudio Grazioli
                wrote on last edited by
                #7

                Sounds very strange. Never heard of that one. But I've experienced similar problems in other situations (I have a button on a tabpage that tends to disappear when I disable/enable it). Do they appear again when you manually call Invalidate() on the form after maximising? Maybe that could be a workaround. Claudio Claudio's Website Hommingberger Gepardenforelle

                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