T
Tim Geiges
I am trying to open an image in a little image viewer I wrote(it has
its own file explorer but I want it to also open from Windows Explorer)
When I select an image from widows explorer and use "Open With"
point it to my app, I can read the args[0] which contains the path to
the file
but I cannot pass the argument to another method to open the image
window
public string thefile = "";
public static void Main(string[] args)
{
Application.Run(new MainForm());
thefile = args[0].ToString();
}
My Documents\SharpDevelop Projects\imgbrowse\MainForm.cs(62,4): error
CS0120: An object reference is required for the nonstatic field,
method, or property 'imgbrowse.MainForm.thefile'
how can I pass the value of args[0] from Main to my ImageView method?
its own file explorer but I want it to also open from Windows Explorer)
When I select an image from widows explorer and use "Open With"
point it to my app, I can read the args[0] which contains the path to
the file
but I cannot pass the argument to another method to open the image
window
public string thefile = "";
public static void Main(string[] args)
{
Application.Run(new MainForm());
thefile = args[0].ToString();
}
My Documents\SharpDevelop Projects\imgbrowse\MainForm.cs(62,4): error
CS0120: An object reference is required for the nonstatic field,
method, or property 'imgbrowse.MainForm.thefile'
how can I pass the value of args[0] from Main to my ImageView method?