Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi i made my program in windows right click but when i right click the picture and open it in my program it doesn't show in the picturebox, how can i make it to open in picturebox?
these are my question pictures
Right Click context on image in windows[^]
this is my prgram image[^]
Posted
Updated 15-Nov-14 11:18am
v2
Comments
Nelek 15-Nov-14 16:08pm    
Don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to add some relevant code to your question or to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.

Please use the "improve question" and add relevant information or a piece of code envolved. There are thousands of ways to screw things up, how are we supposed to know which one did you choose?

Please read:
What have you tried?[^]
How to ask a question?[^]
best way to post code snippets[^]

Those links will help you to improve the quality of your question and hence the probability to get the answer you are looking for
Avenger1 15-Nov-14 17:19pm    
i improved my question please someone answer what should i do
Best Regards
[no name] 15-Nov-14 18:23pm    
What code have you tried?
Sergey Alexandrovich Kryukov 15-Nov-14 19:53pm    
There is no such concept "open a PictureBox" (was it closed? :-). You need to explain exactly what do you want to achieve. Read the "What have you tried" article referenced by Nelek.
—SA
Avenger1 15-Nov-14 23:31pm    
this is the code i tried but it just work for "open with"
string[] args = System.Environment.GetCommandLineArgs();
for (int i = 0; i <= args.Length - 1; i++)
{
if (args[i].EndsWith(".exe") == false)
{
open.FileName = args[i];
pictureBox1.Image = Image.FromFile(open.FileName);
//pictureBox1.Image = Image.FromFile(args[i]);
}
}
and this one but this one don't do anything
Registry.ClassesRoot.OpenSubKey(@"HKEY_CLASSES_ROOT\jpegfile\shell\NewMenuOption\m", true);

1 solution

Probably, it's actually to do with how you added the application to the Associated Files list in the registry: You need to specify the file as a parameter there in order for windows to pass it through.
See here: http://stackoverflow.com/questions/10892433/open-file-with-association[^]
 
Share this answer
 
Comments
Avenger1 17-Nov-14 8:31am    
i don't understand how to use that code
can you help me to write that code?
Best Regards
OriginalGriff 17-Nov-14 8:40am    
It's already written!
Avenger1 17-Nov-14 12:41pm    
i said i didn't understand, my English isn't good
please help me to write that code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900