?
Solved

Open files with double click c#

Posted on 2009-05-14
5
Medium Priority
?
707 Views
Last Modified: 2012-05-07
Hi
Have created a grid of rows of various files names all with different extensions eg/ jpg doc xls

I want to emulate what happens in windows exploers when a user double clicks on the file it opens the file (the row does have the full payh of the file) in the application that windows stores that relates to that extension

Thanks

Rgds
Stephen
0
Comment
Question by:stephenwilde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
tculler earned 1200 total points
ID: 24390263
Calling System.Diagnostics.Process.Start(NameOfFile); will "run" the file using the default program. For example, calling this method on a directory (i.e. System.Diagnostics.Process.Start("C:\\");) will bring up that directory in Windows Explorer. The same goes for pictures and such--the file will just run in the default "associated" application.
0
 
LVL 30

Assisted Solution

by:anarki_jimbel
anarki_jimbel earned 400 total points
ID: 24391284
0
 

Author Comment

by:stephenwilde
ID: 24392501
Thanks - the solution worked perfectly in a quick code sample on hard coded data

But I need to have the functunality as a hyperlink on a cell in a  grid - any ideas on how to implement that useage

Rgds
Stephen
0
 
LVL 1

Assisted Solution

by:secutos
secutos earned 400 total points
ID: 24403426
You can use the grid's event handler OnClick() and detect which item was clicked and respond approprietly.
0
 

Author Closing Comment

by:stephenwilde
ID: 31581716
Thankyou
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question