

The code for the program below will allow the user to enter their name, select the day of the week that their birthday falls on this year and then choose the month of their birthday from the list box. As the user entered the word Hello it takes what it is in the text box and adds it into the message box. The text “You entered the word” is joined with the text box txtWord. This is what happens when the button is clicked: When they enter the word in the text box called txtWord and press the button called btnRun it will display a message box that says what word they entered.Ĭode when btnRun clicked MessageBox.Show("You entered the word " & txtWord.Text) If you want to change what the form control says on it, you change the option text, as shown below:īelow is an interface where the user will enter a word. You must always name controls, this can be done in the properties next to the option name, as shown below: If you had a text box where the user enters their name a suitable name would be txtName.ĭifference between naming a control and changing the text You should add a prefix to any form control, the common ones are: When you have dragged your form controls onto your form, you need to name them. In Visual Studio on the left hand side you have the toolbox, this is where you can drag and drop your form controls.
