?
Solved

Open files with double click c#

Posted on 2009-05-14
5
Medium Priority
?
708 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

650 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