Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Open a file with its default application when it is double-clicked

 
Subscribe to the RSS feed for this forum  Forum Index -> FolderView.Net/WPF
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Sat Jan 03, 2009 10:38 am    Post subject: HOWTO: Open a file with its default application when it is double-clicked

To execute the default command on a file when it is double-clicked (typically 'open', which opens the file with its associated application), handle the FolderView.NodeDoubleClick event and use the following code in the event handler:

[C#]
Code:
void folderView_NodeDoubleClick(object sender, FolderViewEventArgs e)
{
if (!e.Node.IsFolder()) // Only execute default command for files
{
e.Node.ExecuteShellCommand(LogicNP.FolderViewControl.ShellCommands.Default);
}
}


[VB.Net]
Code:
Private Sub fldrView_NodeDoubleClick(ByVal sender As System.Object, ByVal e As LogicNP.FolderViewControl.FolderViewEventArgs) Handles fldrView.NodeDoubleClick

If (e.Node.IsFolder() = False) Then ' Only execute default command for files
    e.Node.ExecuteShellCommand(LogicNP.FolderViewControl.ShellCommands.Default)
End If

End Sub
Back to top
Display posts from previous:   
Forum Index -> FolderView.Net/WPF All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group