What does exactly happen when we open file with?
And above code where to write that in load event? That looks like manually writing.
Actually i wanted to know how can I take arguments from system when user will open file with our program by right click>open with?
There is no event that I am aware of that triggers when you open a file from within your program. You don't need an event triggered because you are already executing code, starting with the method you called to open the file. As for "open with", you can set your program as the default in the Open With dialog. If you don't want to set it as the default then clear the "Always Open With" checkbox.