Как развернуть график zedgraph на всю форму так как показано в скриншоте
И чтоб кнопка показать автоматически смещалась в нижний правый угол?
Stack Overflow на русском — это сайт вопросов и ответов для программистов. Присоединяйтесь! Регистрация займёт не больше минуты.
Присоединиться к сообществуВ меню свойства, есть Anchor - определяющий грани контейнера, к которому привязан элемент! С этим свойством поиграйся)
private void Form1_Load(object sender, EventArgs e)
{
buttonHide.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
zedgraph1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top)));
}
private void buttonHide_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Maximized;
}
private void Form1_Load(object sender, EventArgs e)
{
buttonHide.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
zedGraph.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top)));
this.WindowState = FormWindowState.Maximized;
}
int vkl = 0;
private void button1_Click(object sender, EventArgs e)
{
vkl++;
if (vkl % 2 == 0)
{
buttonHide.Text = "Cкрыть";
buttonHide.Location = new System.Drawing.Point(877, 510);
//buttonHide.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
tabControl1.Visible = true;
labelTimeStart.Visible = true;
textBoxTimeStart.Visible = true;
labelTimeFinish.Visible = true;
textBoxTimeFinish.Visible = true;
//labelBackGround.Location = new System.Drawing.Point(12, 510);
//zedGraph.Size = new System.Drawing.Size(940, 466);
}
else
{
buttonHide.Text = "Показать";
//labelOfAxis1[0].Location = new System.Drawing.Point(this.labelBackGround.Location.X + 3, this.labelBackGround.Location.Y + 2);
for (int j = 1; j < countOfAxis; j++)
{
//labelOfAxis1[j].Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
//labelOfAxis1[j].Location = new System.Drawing.Point(877, 718);
}
buttonHide.Location = new System.Drawing.Point(877, 718);
//buttonHide.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
//zedGraph.Size = new System.Drawing.Size(940, 680);
//zedGraph.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
//| System.Windows.Forms.AnchorStyles.Left)
//| System.Windows.Forms.AnchorStyles.Right)));
tabControl1.Visible = false;
labelTimeStart.Visible = false;
textBoxTimeStart.Visible = false;
labelTimeFinish.Visible = false;
textBoxTimeFinish.Visible = false;
//labelBackGround.Location = new System.Drawing.Point(12, 718);
}
}