C# with Delphi

capri

Active member
Joined
Jun 16, 2015
Messages
42
Programming Experience
5-10
Hi,

I would like to know if it is possible to have a C# windows form integrate into delphi, so that the form sits inside a delphi frame.

Thanks
 
In that case, you should be able to simply create a DLL in C# that contains your form as a public type and then reference that DLL in your Delphi project. I'd recommend using the Windows Control Library item template for the C# project if it's available. That will provide all the references required by Windows Forms by default. You'll just have to remove the user control that is added by default and then add your form. That project will then build to a DLL that you can reference in your Delphi project in the same way as you would any other .NET assembly.
 
In that case, you should be able to simply create a DLL in C# that contains your form as a public type and then reference that DLL in your Delphi project. I'd recommend using the Windows Control Library item template for the C# project if it's available. That will provide all the references required by Windows Forms by default. You'll just have to remove the user control that is added by default and then add your form. That project will then build to a DLL that you can reference in your Delphi project in the same way as you would any other .NET assembly.

That sounds interesting. However, can I know what difference it makes with directly creating the dll with windows form?
 
can I know what difference it makes with directly creating the dll with windows form?

If you create a Class Library project then it won't have the references required for Windows Forms by default, unlike a Windows Control Library project. You can absolutely add those references yourself if you prefer and you'll have to if you're using a VS edition that doesn't provide the Windows Control Library project template, but you don't gain anything by doing so.
 
Back
Top Bottom