We help IT Professionals succeed at work.
Get Started

VB.net Prompt user using Windows form

Murray Brown
Murray Brown asked
Last Modified: 2015-08-15

I have a Windows Form that I use to prompt the user. It is loaded with a list that the user
has to make a selection from.
I have an OK button that then runs the rest of the code.
Is there a way to pause the code, show the form and then run the rest of the code
without havening to channel it through the OK button?

In essence, I want the Windows form to gather feedback just like the OpenFileDialog would in the
following code and gather feedback from the user
                      With Globals.ThisAddIn.oAUTOMATOR.OpenFileDialog1
                            .FileName = ""
                            .InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
                            .Filter = Nothing

                            sFileAndPath = .FileName
                            sPath = System.IO.Path.GetDirectoryName(sFileAndPath)
                            sFile = System.IO.Path.GetFileName(sFileAndPath)
                            oSource_File = sFileAndPath
                        End With
Watch Question
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE