Click here to Skip to main content
15,891,904 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mouse Button > keystroke Pin
Kentamanos11-Feb-04 11:55
Kentamanos11-Feb-04 11:55 
GeneralRe: Mouse Button > keystroke Pin
Spanky311-Feb-04 11:54
Spanky311-Feb-04 11:54 
GeneralNearly Sorted! Pin
Spanky311-Feb-04 12:02
Spanky311-Feb-04 12:02 
GeneralRe: Nearly Sorted! Pin
Spanky311-Feb-04 12:15
Spanky311-Feb-04 12:15 
GeneralRe: Nearly Sorted! Pin
Kentamanos11-Feb-04 12:18
Kentamanos11-Feb-04 12:18 
GeneralRe: Nearly Sorted! Pin
Spanky311-Feb-04 12:21
Spanky311-Feb-04 12:21 
QuestionHow do you do: On Explorer, right click on file -> Open with...-> MyApp.exe ? Pin
mdundek11-Feb-04 7:01
mdundek11-Feb-04 7:01 
AnswerRe: How do you do: On Explorer, right click on file -> Open with...-> MyApp.exe ? Pin
Heath Stewart11-Feb-04 9:43
protectorHeath Stewart11-Feb-04 9:43 
Explorer passes the complete filename (including path) as the first argument to your entry point. You need to validate that an argument was provided and pass that to your main form when/after you instantiate it:
public class MainForm : Form
{
  public static void Main(string[] args)
  {
    string filename = null;
    if (args.Length > 0) filename = args[0];
    Application.Run(new MainForm(filename));
  }
  public MainForm() : this(null)
  {
  }
  private string filename;
  public MainForm(string filename)
  {
    this.filename = filename;
  }
  public string Filename
  {
    get { return this.filename; }
    set { this.filename = value; }
  }
  // ...
}
Alternatively, you can use Environment.GetCommandLineArgs in your application somewhere to essentially do the same thing as was done in the Main entry point method.

 

Microsoft MVP, Visual C#
My Articles
Questionhow to draw an X axis by datetime data! Pin
Member 185560811-Feb-04 4:23
Member 185560811-Feb-04 4:23 
AnswerRe: how to draw an X axis by datetime data! Pin
leppie11-Feb-04 6:05
leppie11-Feb-04 6:05 
GeneralComputer Info Pin
Kenneth Childs11-Feb-04 4:11
Kenneth Childs11-Feb-04 4:11 
GeneralRe: Computer Info Pin
hxxbin11-Feb-04 4:21
hxxbin11-Feb-04 4:21 
GeneralRe: Computer Info Pin
Kenneth Childs11-Feb-04 5:01
Kenneth Childs11-Feb-04 5:01 
GeneralRe: Computer Info Pin
Heath Stewart11-Feb-04 9:38
protectorHeath Stewart11-Feb-04 9:38 
GeneralRe: Computer Info Pin
Heath Stewart11-Feb-04 9:51
protectorHeath Stewart11-Feb-04 9:51 
GeneralRe: Computer Info Pin
Daniel Turini11-Feb-04 4:33
Daniel Turini11-Feb-04 4:33 
Generalcreating and editing Resource files Pin
POKRI11-Feb-04 3:57
POKRI11-Feb-04 3:57 
GeneralRe: creating and editing Resource files Pin
OmegaSupreme11-Feb-04 9:29
OmegaSupreme11-Feb-04 9:29 
GeneralRe: creating and editing Resource files Pin
Heath Stewart11-Feb-04 9:34
protectorHeath Stewart11-Feb-04 9:34 
GeneralPDF Viewer Pin
Mahesh Varma11-Feb-04 2:34
Mahesh Varma11-Feb-04 2:34 
GeneralRe: PDF Viewer Pin
Heath Stewart11-Feb-04 2:53
protectorHeath Stewart11-Feb-04 2:53 
GeneralTable Names Of a MS Access Database Pin
Daminda11-Feb-04 1:06
Daminda11-Feb-04 1:06 
GeneralRe: Table Names Of a MS Access Database Pin
Heath Stewart11-Feb-04 3:04
protectorHeath Stewart11-Feb-04 3:04 
GeneralRe: Table Names Of a MS Access Database Pin
Spanky311-Feb-04 8:18
Spanky311-Feb-04 8:18 
GeneralWe are inviting you to hotdotnet. Pin
Anonymous11-Feb-04 0:19
Anonymous11-Feb-04 0:19 

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.