日期:2014-05-17 浏览次数:21022 次
namespace Test
{
public partial class ShowValue : Form
{
public int nID = 0;
public ShowValue()
{
InitializeComponent();
MessageBox.Show(nID.ToString());
}
}
}
------解决方案--------------------
GisChartWindow子窗口中设置属性,例如:
namespace Test
{
public partial class GisChartWindow : Form
{
public int nID = 0;
public ShowValue()
{
InitializeComponent();
MessageBox.Show(nID.ToString());
}
}
}
------解决方案--------------------
2次都搞错了,把ShowValue改成GisChartWindow就行
------解决方案--------------------
private void SiPingRuiAn_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
GisChartWindow gischartwindow = new GisChartWindow("A楼", "B001");
gischartwindow.Show();
}
public GisChartWindow(string title, string tag)
{
InitializeComponent();
string str1 = title;
string str2 = tag;
}
------解决方案--------------------
构造函数里加。
------解决方案--------------------
在子窗口Load方法里进行赋值不就好了
1、赋值
private void SiPingRuiAn_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
GisChartWindow gischartwindow = new GisChartWindow();
gischartwindow.strParam1 = "A楼";
gischartwindow.strParam2 = "B001";
gischartwindow.Show();
}