Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
QuestionSerializing a ResourceDictionary to binary and back Pin
Imagiv28-Apr-16 8:25
Imagiv28-Apr-16 8:25 
AnswerRe: Serializing a ResourceDictionary to binary and back Pin
Matt T Heffron28-Apr-16 14:48
professionalMatt T Heffron28-Apr-16 14:48 
GeneralRe: Serializing a ResourceDictionary to binary and back Pin
Imagiv28-Apr-16 15:39
Imagiv28-Apr-16 15:39 
QuestionIs it possible to read all probe response coming to a certain access point Pin
mohammed qaid28-Apr-16 7:31
mohammed qaid28-Apr-16 7:31 
Question[SOLVED] Drag and drop file explorer Pin
AndrewRue28-Apr-16 2:47
professionalAndrewRue28-Apr-16 2:47 
AnswerRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 3:02
mveOriginalGriff28-Apr-16 3:02 
GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 3:11
professionalAndrewRue28-Apr-16 3:11 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 3:26
mveOriginalGriff28-Apr-16 3:26 
When I do drag and/or drop with files, I use a collection of actual files, just like the "regular" Windows Explorer does - there's even a DataFormat for them!

Keep your drag and drop separate: your Drop is relying on the ItemDrag event of your Source setting up your names appropriately. Don't do that: Make the source provide the info, and the Destination accept them.
The way I accept them is like this:
C#
/// <summary>
/// USer dropped something on the form
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void frmMusicTrackRename_DragDrop(object sender, DragEventArgs e)
    {
    string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
    dgvTracks.Rows.Clear();
    LoadFiles(files);
    }
(It's part of something I wrote when I realised my music collection had three different track naming styles, and wanted to unify them.)

And don't use string concatenation to assemble a full path - use Path.Combine Method (System.IO)[^] instead as it will apply the separaters intelligently.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 19:50
professionalAndrewRue28-Apr-16 19:50 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 20:54
mveOriginalGriff28-Apr-16 20:54 
GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 21:27
professionalAndrewRue28-Apr-16 21:27 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 22:44
mveOriginalGriff28-Apr-16 22:44 
QuestionShouldnt this work? Pin
David Reeves27-Apr-16 12:25
David Reeves27-Apr-16 12:25 
AnswerRe: Shouldnt this work? Pin
Dave Kreskowiak27-Apr-16 13:54
mveDave Kreskowiak27-Apr-16 13:54 
AnswerRe: Shouldnt this work? Pin
Brisingr Aerowing27-Apr-16 14:21
professionalBrisingr Aerowing27-Apr-16 14:21 
GeneralRe: Shouldnt this work? Pin
David Reeves27-Apr-16 14:40
David Reeves27-Apr-16 14:40 
GeneralRe: Shouldnt this work? Pin
Philippe Mori27-Apr-16 15:57
Philippe Mori27-Apr-16 15:57 
GeneralRe: Shouldnt this work? Pin
Sascha Lefèvre27-Apr-16 21:27
professionalSascha Lefèvre27-Apr-16 21:27 
GeneralRe: Shouldnt this work? Pin
David Reeves28-Apr-16 1:18
David Reeves28-Apr-16 1:18 
QuestionUsing a scripting language in a C# exe Pin
Foothill27-Apr-16 8:37
professionalFoothill27-Apr-16 8:37 
AnswerRe: Using a scripting language in a C# exe Pin
Pete O'Hanlon27-Apr-16 9:22
mvePete O'Hanlon27-Apr-16 9:22 
GeneralRe: Using a scripting language in a C# exe Pin
Foothill27-Apr-16 9:41
professionalFoothill27-Apr-16 9:41 
AnswerRe: Using a scripting language in a C# exe Pin
Sascha Lefèvre27-Apr-16 10:05
professionalSascha Lefèvre27-Apr-16 10:05 
GeneralRe: Using a scripting language in a C# exe Pin
Foothill27-Apr-16 11:19
professionalFoothill27-Apr-16 11:19 
GeneralRe: Using a scripting language in a C# exe Pin
Brisingr Aerowing27-Apr-16 17:24
professionalBrisingr Aerowing27-Apr-16 17:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.