D
David Martin
I am working with some third part code. The method in question has the
following signature:
public sub Add(ByVal ObjProperty as String, ByRef ctrl as
System.Windows.Forms.Controls)
The problem is that I need to pass a control that is not in the
System.Windows.Forms.Controls namespace. It is an Infragistics control.
In the past, using VB.net, I have been able to call the above method with
this:
controlbinder.Add("Name", DirectCast(txtName, Control))
Now I need to be able to do this same thing from C#. I have tried
controlbinder.Add("Name", (Control) txtName);
and
controlbinder.Add("Name", ref txtName);
and
controlbinder.Add("Name", ref (Control) txtName);
Any help would be greatly appreciated.
David Martin
following signature:
public sub Add(ByVal ObjProperty as String, ByRef ctrl as
System.Windows.Forms.Controls)
The problem is that I need to pass a control that is not in the
System.Windows.Forms.Controls namespace. It is an Infragistics control.
In the past, using VB.net, I have been able to call the above method with
this:
controlbinder.Add("Name", DirectCast(txtName, Control))
Now I need to be able to do this same thing from C#. I have tried
controlbinder.Add("Name", (Control) txtName);
and
controlbinder.Add("Name", ref txtName);
and
controlbinder.Add("Name", ref (Control) txtName);
Any help would be greatly appreciated.
David Martin