Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27351

VS 2010 Return focus to an inputbox?

$
0
0
Upon clicking a button, a new window opens with an inputbox requiring info. However, if the box is left blank, I want to produce a messagebox error and return the user to the inputbox. This is what I've got so for:

Code:

Dim new_dir As String
        new_dir = InputBox("Enter directory name:", "Add new directory")
        If new_dir = "" Then
            MessageBox.Show("Directory name must be entered!", "ERROR", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error)
            ***INPUTBOX FOCUS HERE***
        Else
            IO.File.Create(new_dir)
        End If

What should I enter in the ***INPUTBOX FOCUS HERE*** line?

Viewing all articles
Browse latest Browse all 27351

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>