问这个问题的人好像还很多,主要是不清楚所谓面向对象的一些基本东西。随便写两个窗体的例子,在第二个窗体中改变主窗体的label控件的text值:
//Form1.cs:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication3
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
public System.Windows.Forms.Label label1;
public static Form1 frm1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();