http://www.visual-basic-tutorials.com/
It often happens that you need to prompt the user to enter an expected value.
VB.NET Console Application:
It often happens that you need to prompt the user to enter an expected value.
VB.NET Console Application:
Dim nl As String = Environment.NewLine' say hi and ask them for a nameConsole.WriteLine("Hello there. What's your name?" + nl)Dim input = Console.ReadLine()' say something to the userConsole.WriteLine(nl & "Nice to meet you " & input & "." & nl)Console.Read()
VB>NET Windows Form Application
Dim prompt As String = String.EmptyDim title As String = String.EmptyDim defaultResponse As String = String.EmptyDim answer As Object' Set prompt.prompt = "Hello there. What's your name?"' Set title.title = "Getting user input"' Set default value.defaultResponse = "Your name here"' Display prompt, title, and default value.answer = InputBox(prompt, title, defaultResponse) ' Say something to the userMessagebox.Show("Nice to meet you " & answer)
No comments:
Post a Comment