Click here to Skip to main content
16,004,977 members
Home / Discussions / C#
   

C#

 
AnswerRe: Threading.Timer Problem Pin
Skippums20-Nov-07 7:03
Skippums20-Nov-07 7:03 
GeneralRe: Threading.Timer Problem Pin
Darryl Borden20-Nov-07 11:37
Darryl Borden20-Nov-07 11:37 
QuestionHow can I load an image in C# Pin
apoll20-Nov-07 6:29
apoll20-Nov-07 6:29 
AnswerRe: How can I load an image in C# Pin
Judah Gabriel Himango20-Nov-07 6:41
sponsorJudah Gabriel Himango20-Nov-07 6:41 
GeneralRe: How can I load an image in C# Pin
apoll20-Nov-07 6:50
apoll20-Nov-07 6:50 
GeneralRe: How can I load an image in C# Pin
Skippums20-Nov-07 6:58
Skippums20-Nov-07 6:58 
GeneralRe: How can I load an image in C# Pin
apoll20-Nov-07 7:07
apoll20-Nov-07 7:07 
GeneralRe: How can I load an image in C# Pin
MCEdwards20-Nov-07 7:23
MCEdwards20-Nov-07 7:23 
Apoll

The contructor is run when the a class is instantiated. A constructor has the same name as the class. In your code the constructor is

<br />
public Form1(){<br />
 InitializeComponent();<br />
}<br />


What you will want to do is pass in the file name from the arguments list into this constructor. Modify the constructor to accept the path as a string like so:
<br />
public Form1(string ImagePath){<br />
  InitializeComponent();<br />
}<br />


Then in the main method pass the path to the new form like so:
<br />
static void Main(string[] arguments)<br />
{<br />
  Application.EnableVisualStyles();<br />
  Application.SetCompatibleTextRenderingDefault(false);<br />
  Application.Run(new Form1(arguments[0]));<br />
}<br />


I have assumed that the path is stored as the first item in the array.

You can then call the initialize method and pass in the path to the file (you will of course have to modify your initialize method to accept the file path as a parameter.

Hope this helps. Smile | :)
GeneralRe: How can I load an image in C# Pin
apoll20-Nov-07 7:53
apoll20-Nov-07 7:53 
GeneralRe: How can I load an image in C# Pin
Skippums20-Nov-07 7:58
Skippums20-Nov-07 7:58 
GeneralRe: How can I load an image in C# Pin
apoll20-Nov-07 8:25
apoll20-Nov-07 8:25 
GeneralRe: How can I load an image in C# Pin
Skippums20-Nov-07 9:02
Skippums20-Nov-07 9:02 
GeneralRe: How can I load an image in C# Pin
apoll20-Nov-07 9:26
apoll20-Nov-07 9:26 
QuestionHow can I read the file's content on server? Pin
pcphuc20-Nov-07 5:57
pcphuc20-Nov-07 5:57 
AnswerRe: How can I read the file's content on server? Pin
Judah Gabriel Himango20-Nov-07 8:07
sponsorJudah Gabriel Himango20-Nov-07 8:07 
GeneralRe: How can I read the file's content on server? Pin
pcphuc20-Nov-07 14:14
pcphuc20-Nov-07 14:14 
GeneralRe: How can I read the file's content on server? Pin
pcphuc20-Nov-07 14:43
pcphuc20-Nov-07 14:43 
GeneralRe: How can I read the file's content on server? Pin
pcphuc20-Nov-07 17:10
pcphuc20-Nov-07 17:10 
GeneralRe: How can I read the file's content on server? Pin
Judah Gabriel Himango21-Nov-07 5:16
sponsorJudah Gabriel Himango21-Nov-07 5:16 
QuestionPreventing Control Painting Pin
DahrkDaiz20-Nov-07 5:34
DahrkDaiz20-Nov-07 5:34 
AnswerRe: Preventing Control Painting Pin
Skippums20-Nov-07 6:02
Skippums20-Nov-07 6:02 
QuestionFree unmanaged memory issue Pin
sampdoria20-Nov-07 5:33
sampdoria20-Nov-07 5:33 
Questioninteresting topic plz help Pin
sivaramireddy p20-Nov-07 4:57
sivaramireddy p20-Nov-07 4:57 
AnswerYou must be kidding! Pin
leckey20-Nov-07 5:08
leckey20-Nov-07 5:08 
AnswerRe: interesting topic plz help Pin
duncanmhor20-Nov-07 5:38
duncanmhor20-Nov-07 5:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.