我有以下代码模式:
[VB6]
Dim objNetDllObject As New NetDllObject
objNetDllObject.PassVb6Form(MyForm)
objNetDllObject.ShowForm
[C#]
object Vb6Form;
private void PassVb6Form(object form) { Vb6Form = form; }
private void button1_Click(object sender, EventArgs e) { Vb6Form.Show(); }
问题是 C# 编译器不喜欢该Vb6Form.Show()
语句,因为Show()
它不是 的函数object
,这是真的。如何编译此代码?