I have seen a demo of F# and DirectX.
User selects a part of F# code and sends it to F# interactive. It between, the form's thread is working: the form shows dynamic content and responds to clicks.
Can I conclude that for existing C# winforms project I can create a F# project which references it and then launch the F# project in F# interactive to run arbitrary methods of a form ?
EDIT: what are the steps to invoke btShowNextNumber_Click
in a running application ?
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int i = 0;
private void btShowNextNumber_Click(object sender, EventArgs e)
{
++i;
label1.Text = i.ToString();
}
}
Sure. In F# interactive, you'd run something like:
#r "MyDllName.dll"
open MyNamespace
// Call the constructor to get a new form, then show it
let form = Form1()
form.Show()
// Call whatever public method you want
form.MyMethodThatIWantToUse()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With