Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 9th, 2007, 05:58 PM
Friend of Wrox
 
Join Date: Sep 2007
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
Default Simulate a double click?

Hi

I am wondering how do you simulate a double click in C#? I have a button called import into webEq and when a user clicks on this button I want that file to open in the webEq program(much like if you have word document and you double click on it opens up the file in word).

I have the webEq extension(.mml) and I a using it on the file. I have tried the file I named with the mml extension and it opens it up. Now I just need some code that simulates that.

Thanks

 
Old November 9th, 2007, 09:50 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hmm, I am confused. Do you mean that when you click on your import button you want a certain program to open your file with the .mml extension?

So, for example, if u were working with .doc files would you be expecting word to open once you click your import button?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old November 9th, 2007, 09:53 PM
Friend of Wrox
 
Join Date: Sep 2007
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
Default

Yes when they hit that import button that certain program that file extension belongs to opens up and loads that file. Just as if you had helloworld.doc and you clicked on the file it would open microsoft word and it would open the file.

 
Old November 9th, 2007, 10:46 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You could use Process.Start() as long as your program excepts parameters to be passed into it. So if i create an app that had a form on it and I asked the user for a URL I could open Internet Explorer with the following code:

Process.Start("IExplore.exe", "www.google.com"); which will open IE at Google.

Here is the thing though, if the program you want to use to open your mml files is not integrated into the windows shell (what i mean by this is that if i open a run menu i can simply type iexplore into it and windows will open Internet Explorer) you will need to provide the physical path to the exe as the first parameter of Proccess.Start().

More info can be found here:
http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.start(VS.71).aspx

hth

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old November 9th, 2007, 11:08 PM
Friend of Wrox
 
Join Date: Sep 2007
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
Default

Ic what you mean. No webEq does not work with the run command so I will have to give the full path to it. How can I make the path relative enough so I don't have to hard code the path(since I can't be sure that a person will have it under C:\Program Files\WebEQ Evaluation\3.7\bin

I am sure they will not rename it completely(they probably won't change this \WebEQ Evaluation\3.7\bin)

but I can't say for certain that they will save it under C:\Program Files.

 
Old November 10th, 2007, 06:15 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You can just ass the filename ask the first parameter.

Process.Start("C:\test.mml");

If double clicking the file in windows explorer would open your webeq program then this should work.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
double click problem naveed77 Beginning VB 6 0 December 4th, 2007 03:49 AM
Double-click event Grafixx01 Access 6 May 7th, 2007 08:09 AM
Right-Click or Double-Click Combobox? panuvin C# 2005 3 June 15th, 2006 04:30 PM
Simulate an ImageButton Click Event pvasudevan ASP.NET 1.x and 2.0 Application Design 0 July 8th, 2004 06:34 AM
Double Click problem Merlin Java GUI 1 March 31st, 2004 10:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.