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. Windows Forms
  4. Parent and child forms

Parent and child forms

Scheduled Pinned Locked Moved Windows Forms
3 Posts 2 Posters 2 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.
  • S Offline
    S Offline
    sarah_malik
    wrote on last edited by
    #1

    Hello everybody, I need to make the client size of a parent form FIXED, that is no scroll bars appear when moving the child around the parent. I tried to make the auto scroll bar property in parent form set to false but it doesn't work. thanks in advance!

    C 1 Reply Last reply
    0
    • S sarah_malik

      Hello everybody, I need to make the client size of a parent form FIXED, that is no scroll bars appear when moving the child around the parent. I tried to make the auto scroll bar property in parent form set to false but it doesn't work. thanks in advance!

      C Offline
      C Offline
      CompMan44
      wrote on last edited by
      #2

      I tried out what you described with the following code:

      using System.Windows.Forms;

      class Form1: Form
      {
      public Form1()
      {
      this.IsMdiContainer = true;

        this.AutoScroll = false;
      
        Form f = new Form();
        f.MdiParent = this;
        f.Show();
      

      }

      public static void Main (string[] args)
      {
      Application.Run(new Form1());
      }
      }

      Of course, the scrollbars still appear. According to the documentation for Form.AutoScroll, "If this property is set to true, scroll bars are displayed on the form if any controls are located outside the form's client region." I would take this to mean that AutoScroll only applies to controls owned by the form, not MDI children. Sorry I couldn't be of more help.

      A little learning is a dangerous thing; Drink deep, or taste not, the Pierian Spring. —Alexander Pope

      S 1 Reply Last reply
      0
      • C CompMan44

        I tried out what you described with the following code:

        using System.Windows.Forms;

        class Form1: Form
        {
        public Form1()
        {
        this.IsMdiContainer = true;

          this.AutoScroll = false;
        
          Form f = new Form();
          f.MdiParent = this;
          f.Show();
        

        }

        public static void Main (string[] args)
        {
        Application.Run(new Form1());
        }
        }

        Of course, the scrollbars still appear. According to the documentation for Form.AutoScroll, "If this property is set to true, scroll bars are displayed on the form if any controls are located outside the form's client region." I would take this to mean that AutoScroll only applies to controls owned by the form, not MDI children. Sorry I couldn't be of more help.

        A little learning is a dangerous thing; Drink deep, or taste not, the Pierian Spring. —Alexander Pope

        S Offline
        S Offline
        sarah_malik
        wrote on last edited by
        #3

        CompMan44 wrote:

        I would take this to mean that AutoScroll only applies to controls owned by the form, not MDI children.

        I think you are right, thanks CompMan44:)

        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