Hi Ron
I've already done lots of work on the form. Do I start again or am I heading in the right direction here:
In program.cs
namespace ECN_Manager
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
string ecnNumber = "";
if (args.Length > 1)
{
ecnNumber = System.IO.File.ReadAllText(args[1]);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 myForm = new Form1();
myForm.ECNNumber = ecnNumber;
Application.Run(myForm);
}
}
}
In Form1.cs
namespace ECN_Manager
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string ECNNumber { get; set; }
public override void OnShown(EventArgs e)
{
if (!string.IsNullOrEmpty(ECNNumber))
{
this.txtECNNo.Text = ECNNumber;
}
}
}
}
but getting error on: "public override void OnFormShown(EventArgs e)" (No Siutable method found to Override)
Not that familiar with C#, but could I not put an optional parameter in the constructor?
<pre lang="c#">
public Form1(optional string ECNNumber)
{
InitializeComponent();
}