Click here to Skip to main content
14,387,650 members
   

C#

 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan24-Nov-19 23:11
mveRichard MacCutchan24-Nov-19 23:11 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Super Lloyd24-Nov-19 19:21
MemberSuper Lloyd24-Nov-19 19:21 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan24-Nov-19 23:07
mveRichard MacCutchan24-Nov-19 23:07 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Super Lloyd25-Nov-19 12:52
MemberSuper Lloyd25-Nov-19 12:52 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Member 245846728-Nov-19 20:25
MemberMember 245846728-Nov-19 20:25 
QuestionHow to delete a file during build/execute in C# Pin
Member 1466381121-Nov-19 6:24
MemberMember 1466381121-Nov-19 6:24 
AnswerRe: How to delete a file during build/execute in C# Pin
OriginalGriff21-Nov-19 7:00
mveOriginalGriff21-Nov-19 7:00 
Question[Solved] Drag and Drop a folder to a textBox within a User Control Pin
W3453121-Nov-19 3:45
MemberW3453121-Nov-19 3:45 
I have a Windows Forms Application and added a User Control to the project. The User Control contains a TextBox and a button, the button opens FolderBrowseDialog, however the drag and drop code section is not working. If I use the drag and drop code on a Form without a User Control it works perfectly, but not contained within the User Control on a Form. Not sure on how to go about this, any advice will be greatly appreciated.

Form1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestCopyFolder
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    }
}


ucCopyDir.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestCopyFolder
{
    public partial class ucCopyDir : UserControl
    {
        public ucCopyDir()
        {
            InitializeComponent();
        }

        private void txtBoxCpSrc_DragEnter(object sender, DragEventArgs e)
        {
            // Drag and drop effect in windows
            if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
            {
                e.Effect = DragDropEffects.All;
            }
        }

        // Source Drag and Drop section
        private void txtBoxCpSrc_DragDrop(object sender, DragEventArgs e)
        {
            // This just allows you to drop a file into the source textbox and display it's path.
            string[] files1 = (string[])e.Data.GetData(DataFormats.FileDrop,false);
            foreach (string file1 in files1)
                txtBoxCpSrc.Text = file1;
        }

        private void btnCpSrcBrowse_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            if (fbd.ShowDialog() == DialogResult.OK)
            {
                txtBoxCpSrc.Text = (fbd.SelectedPath);
            }
        }
    }
}


modified 22-Nov-19 5:05am.

AnswerRe: Drag and Drop a folder to a textBox within a User Control Pin
Dave Kreskowiak21-Nov-19 5:52
mveDave Kreskowiak21-Nov-19 5:52 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
W3453121-Nov-19 20:47
MemberW3453121-Nov-19 20:47 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
Dave Kreskowiak22-Nov-19 2:58
mveDave Kreskowiak22-Nov-19 2:58 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
W3453122-Nov-19 4:01
MemberW3453122-Nov-19 4:01 
QuestionExtract variables from string math expression with parenthesis Pin
foreigh20-Nov-19 23:14
Memberforeigh20-Nov-19 23:14 
AnswerRe: Extract variables from string math expression with parenthesis Pin
OriginalGriff20-Nov-19 23:56
mveOriginalGriff20-Nov-19 23:56 
GeneralRe: Extract variables from string math expression with parenthesis Pin
foreigh21-Nov-19 0:32
Memberforeigh21-Nov-19 0:32 
GeneralRe: Extract variables from string math expression with parenthesis Pin
OriginalGriff21-Nov-19 0:50
mveOriginalGriff21-Nov-19 0:50 
QuestionHow to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 21:07
MemberMahmoud EL-Shazly20-Nov-19 21:07 
AnswerRe: How to use recursion to build dynamic menu from database in c# Pin
OriginalGriff20-Nov-19 22:46
mveOriginalGriff20-Nov-19 22:46 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 22:49
MemberMahmoud EL-Shazly20-Nov-19 22:49 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
OriginalGriff20-Nov-19 22:54
mveOriginalGriff20-Nov-19 22:54 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 22:57
MemberMahmoud EL-Shazly20-Nov-19 22:57 
AnswerRe: How to use recursion to build dynamic menu from database in c# Pin
Mycroft Holmes21-Nov-19 13:56
MemberMycroft Holmes21-Nov-19 13:56 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly21-Nov-19 14:19
MemberMahmoud EL-Shazly21-Nov-19 14:19 
Question.NET Standard 2.1, Xamarin Android/iOS & Emit Pin
Super Lloyd19-Nov-19 14:00
MemberSuper Lloyd19-Nov-19 14:00 
AnswerRe: .NET Standard 2.1, Xamarin Android/iOS & Emit Pin
Super Lloyd20-Nov-19 1:45
MemberSuper Lloyd20-Nov-19 1:45 

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.