0

我的表单中有浏览器控制,填满所有屏幕

        WebBrowser objBowser = new WebBrowser();
        objBowser.Dock = DockStyle.Fill;
        this.Controls.Add(objBowser);
        objBowser.Navigate("http://www.google.com/");

并有一个按钮用于将屏幕分成两部分用于两个浏览器控制

private void Form1_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
            WebBrowser objBowser = new WebBrowser();
            objBowser.Width = Screen.PrimaryScreen.WorkingArea.Width ;
            objBowser.Dock = DockStyle.Left;
            this.Controls.Add(objBowser);
            objBowser.Navigate("http://www.google.com/");
        }

    private void button1_Click(object sender, EventArgs e)
    {

        WebBrowser objBowser2 = new WebBrowser();

        objBowser2.Dock = DockStyle.Right;
        this.Controls.Add(objBowser2);
        objBowser2.Navigate("http://www.google.com/");
    }

    private void timer1_Tick(object sender, EventArgs e)
    {
        while ( objBowser2.Width <= Screen.PrimaryScreen.WorkingArea.Width / 2)
        {
            objBowser2.Width += 1;
            objBowser1.Width -= 1;
        }
    }

我已经使用计时器1作为间隔和objBowser2.Width += 1分割动画的技术,但它似乎并不好,知道吗?

4

0 回答 0