When i'm using the below code for Browse Button.
if (openFileDialog1.ShowDialog() == DialogResult.OK)
textBox1.Text = openFileDialog1.FileName;
I'm getting the below error:
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process
I solved myself by using the below code:
private void btnBrowseFile_Click(object sender, EventArgs e)
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)