I was creating a Photo Viewer in C# winform and I was using the openfiledialog to open files in it. But then I thought to make it work as a proper photo viewer if anyone click on its image file eg png, jpg, gif. It opens it in my photo viewer. Or ask it choose it as default photo viewer or open with this app. So there would definitely be some code to open files in such manner, and would also be some process to go through while publishing it to tell the OS that is a photo viewer. An help on how to do this. Also is the process for the text editors and other things like this is same.
Add a comment |
1 Answer
This is a setting in Windows, and is not directly controlled by your program. See here for instructions on how to change this on your PC. If you're distributing your application using an installer, you can have the installer set program associations for you.
5 Comments
mega6382
Thanks Jon, but what I am really asking is when you double click on the image file and it opens in my photo viewer how do I control it like in
openfiledialog() we can use a property filename to get the path to the file. How can we do this by double clicking it.mega6382
This is not C++ this is C# it does not have constructors name as
main() it uses the class name as the constructor. So can you tell me the syntax for C#. Or is it same on both?See also: stackoverflow.com/questions/1179532/…