有3个winfrom窗体,窗体A,窗体B,和窗体C
窗体A和窗体B都都掉用窗体C,但不是同时调用
我怎么在窗体C中判断是窗体A还是窗体B调用的窗体C?
窗体A和窗体B都都掉用窗体C,但不是同时调用
我怎么在窗体C中判断是窗体A还是窗体B调用的窗体C?
解决方案 »
- 请教asp向aspx传递session的问题!
- 怎样给C#的程序加壳
- 导出EXCEL的问题。
- 关于C# 的打印,求打印高手指点
- 获取IP地址的问题?
- 如何编辑文件名?
- 代码已经收到weilysunhg近来接分
- 做个考试系统,想要去掉页面的最大化最小化和关闭按钮
- e as eventargs和sender as object的顺序对程序有什么影响?
- 有谁读过 UDDI, SOAP and WSDL: The Web Services Specification Reference Book, 1/e,介绍一下。
- ActiveControl与SplitContainer问题请教。。
- 两个treeView数据移动,怎么做,
private void button1_Click(object sender, System.EventArgs e)
{
// Create an instance of Form2.
Form1 f2 = new Form1();
// Make this form the parent of f2.
f2.MdiParent = this;
// Display the form.
f2.Show();
}
C++ 复制代码
// The event handler on Form1.
private:
void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
// Create an instance of Form2.
Form1^ f2 = gcnew Form1; // Make this form the parent of f2.
f2->MdiParent = this; // Display the form.
f2->Show();
}
J# 复制代码
// The event handler on Form1.
private void button1_Click(Object sender, System.EventArgs e)
{
// Create an instance of Form2.
Form1 f2 = new Form1();
// Make this form the parent of f2.
f2.set_MdiParent(this);
// Display the form.
f2.Show();
} //button1_Click
Visual Basic 复制代码
' The event handler on Form2.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Get the Name property of the parent.
Dim s As String = ParentForm.Name
' Display the name in a message box.
MessageBox.Show("My parent is " + s + ".")
End Sub 'button1_Click
C# 复制代码
// The event handler on Form2.
private void button1_Click(object sender, System.EventArgs e)
{
// Get the Name property of the Parent.
string s = ParentForm.Name;
// Display the name in a message box.
MessageBox.Show("My Parent is " + s + ".");
}
public int pForm;调用时
btnFormA_Click
{
FromC frm=new FormC();
frm.pForm=1;
frm.Show();
}btnFormB_Click
{
FromC frm=new FormC();
frm.pForm=2;
frm.Show();
}
FormC中判断:
switch(pForm)
{
case 1:
...
break;
case 2:
...
break;
default:
...
break;
}或者FormC的构造函数中直接要求给个调用者的标识也行啊
类似
(new FormC("A")).Show();