日期:2014-05-17  浏览次数:20886 次

C# MDI窗口中填满部分界面的问题
本帖最后由 lmx520_2007 于 2012-11-27 15:53:35 编辑
如图 我要让“回路绘制区”在点击出现后填满父窗口除了“yjk”右侧的部分 而且要保证其随界面变化而相应的变大小 该怎么实现呀
目前相应代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace 界面1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        Form2 yjk = new Form2();
        Form3 huilu = new Form3();
        private void Form1_Load(object sender, EventArgs e)
        {
            yjk.MdiParent = this;
            yjk.StartPosition = FormStartPosition.Manual;
            double x = this.Width;
            double y = this.Height;
            yjk.Width = (int)x / 4;
            yjk.Height = (int)y;
            yjk.Show();
            yjk.ControlBox = false;
            //yjk.FormBorderStyle = FormBorderStyle.None;
            huilu.StartPosition = FormStartPosition.CenterScreen;
            huilu.Dock = DockStyle.Fill;

        }

        private void Form1_SizeChanged(object sender, EventArgs e)
        {
            double x = this.Width;
            double y = this.Height;
            yjk.Width = (int)x / 4;
            yjk.Height = (int)y;
            yjk.Show();
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            
            huilu.MdiParent=this;
            huilu.Text = "回路绘制区";