Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Expanding my form
Message
De
15/10/2004 10:16:59
 
 
À
15/10/2004 09:12:20
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00951692
Message ID:
00951724
Vues:
5
Mike,

I usually put an invisible "placeholder" control like a groupbox onto the form and use this as part of the calculation allowing me to use the designer for positioning.
namespace WindowsApplication3
{
    partial class Form1 : Form
    {
        private bool expanded;

        public Form1()
        {
            InitializeComponent();
            expanded = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (expanded)
            {
                this.Height = this.Height - groupBox1.Height;
                expanded = false;
                button1.Text = "Expand >>";
            }
            else
            {
                this.Height = this.Height + groupBox1.Height;
                expanded = true;
                button1.Text = "<< Collapse";
            }
        }
    }
}
Regards
Neil
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform