Solved

Open files with double click c#

Posted on 2009-05-14
5
700 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
5 Comments
 
LVL 9

Accepted Solution

by:
tculler earned 300 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 29

Assisted Solution

by:anarki_jimbel
anarki_jimbel earned 100 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 100 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now