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. Listview DragDrop Visual Themes error...

Listview DragDrop Visual Themes error...

Scheduled Pinned Locked Moved C#
helpquestion
1 Posts 1 Posters 0 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.
  • L Offline
    L Offline
    Leon van Wyk
    wrote on last edited by
    #1

    I am working on a FTP client that works great but when I use file drop from windows explorer the application crashes and ends. The error breaks at the Application.Run(new Mainform); and gives me the following error: "An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll Additional information: External component has thrown an exception." If I put a try catch around that I get this error message Exception.Message = "External component has thrown an exception." I am using Visual Themes and are sure that that is the problem. [STAThread] static void Main() { try { Application.EnableVisualStyles(); Application.DoEvents(); Application.Run(new MainForm()); } catch(Exception Ex) { MessageBox.Show(Ex.Message,"Runtime Error.",MessageBoxButtons.OK,MessageBoxIcon.Error); } } When I take the EnableVisualStyles(); out it works fine. Also when I do a file drop, my progressbar losses the Visual Theme. How do I get around this and still use the Visual Themes? Here is my Drop code: private void listView1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { if( e.Data.GetDataPresent(DataFormats.FileDrop, false)) { string[] files_str = (string[])e.Data.GetData(DataFormats.FileDrop); foreach(string file_str in files_str) { FileInfo droppedFile = new FileInfo(file_str); if(droppedFile.Exists) { UploadFile(droppedFile); } else if(droppedFile.Directory.Exists) { DirectoryInfo droppedDirectory = new DirectoryInfo(file_str); if(droppedDirectory.Exists) { UploadDirectoryChanges(droppedFile.Directory); } } else { MessageBox.Show(file_str +"\nis not recognized as a valid file drop.","Unsupported File drop!",MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } Leon v Wyk

    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