Hello.
I create simple windows form application in powershell
Add-Type -AssemblyName System.Windows.Forms
$Form = New-Object system.Windows.Forms.Form
$Form.ShowDialog()
How to add this code to it?
In C# windows form application it look's like that:
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Timers;
using System.Windows.Forms;
using System;
namespace WindowsFormsApp1Csh
{
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
t = new System.Timers.Timer();
t.Interval = 10;
t.Elapsed += OnTimeEvent;
t.Start();
}
private void OnTimeEvent(object sender, ElapsedEventArgs e)
{
Invoke(new Action(() =>
{
Console.WriteLine("Hello");
}));
}
}
Can i semohow create a public void metho or something like that?
Thanks for help.