Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expanding my form
Message
From
15/10/2004 10:16:59
 
 
To
15/10/2004 09:12:20
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00951692
Message ID:
00951724
Views:
4
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
Previous
Reply
Map
View

Click here to load this message in the networking platform