Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. loading a file on the lisview conttrol by a double click (c#)

loading a file on the lisview conttrol by a double click (c#)

Scheduled Pinned Locked Moved C#
csharpquestion
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gianpaolo Barci
    wrote on last edited by
    #1

    I did this! private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e) { string filePath = lvFiles.SelectedItems.ToString(); ShellLib.ShellExecute shellExecute = new ShellLib.ShellExecute(); shellExecute.Verb = ShellLib.ShellExecute.OpenFile; shellExecute.Path = @"F:\\Painel de Controle ETECH\\Projetos ETECH" + filePath; shellExecute.Execute(); } Am I close??

    D K 2 Replies Last reply
    0
    • G Gianpaolo Barci

      I did this! private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e) { string filePath = lvFiles.SelectedItems.ToString(); ShellLib.ShellExecute shellExecute = new ShellLib.ShellExecute(); shellExecute.Verb = ShellLib.ShellExecute.OpenFile; shellExecute.Path = @"F:\\Painel de Controle ETECH\\Projetos ETECH" + filePath; shellExecute.Execute(); } Am I close??

      D Offline
      D Offline
      Dan Neely
      wrote on last edited by
      #2

      the event you're using will fire as you move down the list via keyboard or do single click selections. There should be a double click event. use that instead.

      Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall

      1 Reply Last reply
      0
      • G Gianpaolo Barci

        I did this! private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e) { string filePath = lvFiles.SelectedItems.ToString(); ShellLib.ShellExecute shellExecute = new ShellLib.ShellExecute(); shellExecute.Verb = ShellLib.ShellExecute.OpenFile; shellExecute.Path = @"F:\\Painel de Controle ETECH\\Projetos ETECH" + filePath; shellExecute.Execute(); } Am I close??

        K Offline
        K Offline
        KaptinKrunch
        wrote on last edited by
        #3

        Also your shellExecute.Verb should be "open". List of Verbs - http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx[^]

        Just because we can; does not mean we should.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups