TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
leosco
NA
13
0
Passing command-line arguments in another form
Nov 2 2010 10:58 AM
nevermind, problem has been solved.
Hi.
I have registered a file association with my program, and when the file is clicked I want it to open with my application by passing a command line argument. I have already done this and in Program.cs I have added:
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Main x = new Main();
x.Launch(args[0]);
Application.Run(x); // I also tried Application.Run(new Main());
}
Launch is a function in my main form, I want to pass the arguments there. From there, I want to change the text of the form (this.Text = args for example), but it doesn't work.
Can someone please help me pass the argument to the main form so I can use it there on my main form?
Reply
Answers (
1
)
Creating PDF files with C# .net 4.0
Delegate's word meaning is representative. A delegate in .Net is juts like a function pointer in C#.