Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent Child Form Resizing
Message
De
19/11/2010 10:50:55
 
 
À
19/11/2010 10:09:30
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 4.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Divers
Thread ID:
01489767
Message ID:
01489781
Vues:
40
>I'm having a problem with a child form getting resized when initialized by the parent form to a size larger than what was set during design time. I have the parent form IsMdiContainer set to true and the child form has it set to be its parent when initialized. For a test I set the child form to 300 x 300 and when the form loads it is set to 436 x 447. The test form has no controls and there is also no custom code in it that may be affecting the resize. I need the child form to remain the size that it is set to during design time. Any help is greatly appreciated.
>
>Initializing Child Form Code:
>frm_srch eum_srch = new frm_srch();
>eum_srch.MdiParent = this;
>eum_srch.Show();
>
>Child Form Properties:
>FormBorderSyle - FixedDialog
>MaximumSize = 300
>MinimumSize = 300
>Size.Height = 300
>Size.Width = 300
>ControlBox = false
>StartPosition = Manual
>TopMost = true

Must be something else going on. Try this:
public  class frm_srch : Form
    {
        public frm_srch()
        {
             this.ControlBox = false;
            this.MaximumSize = new System.Drawing.Size(300, 300);
            this.MinimumSize = new System.Drawing.Size(300, 300);
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "Test";
            this.TopMost = true;
         }
    }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform