private void dragNDropPanel_DragDrop(object sender, DragEventArgs e) { String[] FilesPathes = (String[])e.Data.GetData(DataFormats.FileDrop); //Detect non Files Drop if (FilesPathes == null || FilesPathes.Length == 0) { MessageBox.Show("You can only Drop Files", "Error"); return; } //@TODO: Support Multi File Drop String Extension = Path.GetExtension(FilesPathes[0]).Substring(1); switch (Extension.ToLower()) { case "bmp": BMPToolPanel bmpTool = new BMPToolPanel(); bmpTool.Attach(FilesPathes[0]); bmpTool.Show(); break; default: MessageBox.Show("Cannot Find Associated Handler for this File Type"); break; } }
private void bMPToolToolStripMenuItem_Click(object sender, EventArgs e) { BMPToolPanel bmpTool = new BMPToolPanel(); bmpTool.Show(); }