seeing C# windows forms project code from F#
- by Pessimist
I have a C# Windows Forms project open with some C# code in it.
Question: How can I have an F# file that I can write F# code in but still referencing all the C# code I have on Form1.cs (including the GUI).
I can successfully do this:
- Create a C# Windows Forms project
- Create a F# Library project
- Reference the F# Library DLL from my C# project
- That way I can call F# functions from C#
But I still can't see my buttons and textboxes from F#
I understand that that is because it's a library and it can't reference System.Windows.Forms
So how do I fix this? I don't want it to be a library or this or that, I just want it to be a file that will allow me to write F# code while being able to reference my C# Form and code.
I guess you can say I want an F# file that is also a "partial class Form1" so that I can continue writing code for the same Project, but using F# instead.
How do I do that?