111,131
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication22
{
public partial class Form1 : Form
{
Point P1, P2;
public Form1()
{
InitializeComponent();
}
private void splitContainer1_Panel1_Resize(object sender, EventArgs e)
{
P1 = splitContainer1.Panel1.PointToScreen(new Point(0, 0));
this.Text = "panel1 - (x:" + P1.X + ",y:" + P1.Y + ") panel2 - (x:" + P2.X + ",y:" + P2.Y+")";
}
private void splitContainer1_Panel2_Resize(object sender, EventArgs e)
{
P2 = splitContainer1.Panel2.PointToScreen(new Point(0, 0));
this.Text = "panel1 - (x:" + P1.X + ",y:" + P1.Y + ") panel2 - (x:" + P2.X + ",y:" + P2.Y + ")";
}
private void Form1_Move(object sender, EventArgs e)
{
P1 = splitContainer1.Panel1.PointToScreen(new Point(0, 0));
P2 = splitContainer1.Panel2.PointToScreen(new Point(0, 0));
this.Text = "panel1 - (x:" + P1.X + ",y:" + P1.Y + ") panel2 - (x:" + P2.X + ",y:" + P2.Y + ")";
}
}
}