Click here to Skip to main content
15,897,032 members
Home / Discussions / C#
   

C#

 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan24-Nov-19 22:11
mveRichard MacCutchan24-Nov-19 22:11 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Super Lloyd24-Nov-19 18:21
Super Lloyd24-Nov-19 18:21 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan24-Nov-19 22:07
mveRichard MacCutchan24-Nov-19 22:07 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Super Lloyd25-Nov-19 11:52
Super Lloyd25-Nov-19 11:52 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Member 245846728-Nov-19 19:25
Member 245846728-Nov-19 19:25 
QuestionHow to delete a file during build/execute in C# Pin
Member 1466381121-Nov-19 5:24
Member 1466381121-Nov-19 5:24 
AnswerRe: How to delete a file during build/execute in C# Pin
OriginalGriff21-Nov-19 6:00
mveOriginalGriff21-Nov-19 6:00 
Question[Solved] Drag and Drop a folder to a textBox within a User Control Pin
W3453121-Nov-19 2:45
W3453121-Nov-19 2: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:
C#
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:
C#
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 4:52
mveDave Kreskowiak21-Nov-19 4:52 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
W3453121-Nov-19 19:47
W3453121-Nov-19 19:47 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
Dave Kreskowiak22-Nov-19 1:58
mveDave Kreskowiak22-Nov-19 1:58 
GeneralRe: Drag and Drop a folder to a textBox within a User Control Pin
W3453122-Nov-19 3:01
W3453122-Nov-19 3:01 
QuestionExtract variables from string math expression with parenthesis Pin
foreigh20-Nov-19 22:14
foreigh20-Nov-19 22:14 
AnswerRe: Extract variables from string math expression with parenthesis Pin
OriginalGriff20-Nov-19 22:56
mveOriginalGriff20-Nov-19 22:56 
GeneralRe: Extract variables from string math expression with parenthesis Pin
foreigh20-Nov-19 23:32
foreigh20-Nov-19 23:32 
GeneralRe: Extract variables from string math expression with parenthesis Pin
OriginalGriff20-Nov-19 23:50
mveOriginalGriff20-Nov-19 23:50 
QuestionHow to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 20:07
Mahmoud EL-Shazly20-Nov-19 20:07 
AnswerRe: How to use recursion to build dynamic menu from database in c# Pin
OriginalGriff20-Nov-19 21:46
mveOriginalGriff20-Nov-19 21:46 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 21:49
Mahmoud EL-Shazly20-Nov-19 21:49 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
OriginalGriff20-Nov-19 21:54
mveOriginalGriff20-Nov-19 21:54 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly20-Nov-19 21:57
Mahmoud EL-Shazly20-Nov-19 21:57 
AnswerRe: How to use recursion to build dynamic menu from database in c# Pin
Mycroft Holmes21-Nov-19 12:56
professionalMycroft Holmes21-Nov-19 12:56 
GeneralRe: How to use recursion to build dynamic menu from database in c# Pin
Mahmoud EL-Shazly21-Nov-19 13:19
Mahmoud EL-Shazly21-Nov-19 13:19 
Question.NET Standard 2.1, Xamarin Android/iOS & Emit Pin
Super Lloyd19-Nov-19 13:00
Super Lloyd19-Nov-19 13:00 
AnswerRe: .NET Standard 2.1, Xamarin Android/iOS & Emit Pin
Super Lloyd20-Nov-19 0:45
Super Lloyd20-Nov-19 0: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.