没有那简单,自己看代码,刚写的
三个页面,一个主监控页面
一个主页面,一个跟随页面
代码如下,代码没有怎么整理,肯定写的不台好看,目的只是证明方法是否可行.
代码一
主监控窗口fMain.cs
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WT
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class fMain : System.Windows.Forms.Form
{
private static bool islian=false;//是否被吸引住
private static int liantype;//吸引方向
private static int cxmax=20;//磁性距离最大距离正值
private static int cxmin=-20;//磁性距离最大距离负值
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private static Form f1=new F1();
private System.Windows.Forms.Label label1;
private static Form f2=new F2();
public fMain()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();