1 / 11

GUI Programming in Visual Studio .NET

GUI Programming in Visual Studio .NET. Chapter 3 Tariq Aziz and Kevin Jones. Overview. Chapter 3 is about using Toolbox controls in Visual Studio .NET. TextBox Button CheckBox RadioButton ListBox ComboBox DateTimePicker LinkLabel. TextBox.

cale
Télécharger la présentation

GUI Programming in Visual Studio .NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GUI Programmingin Visual Studio .NET Chapter 3 Tariq Aziz and Kevin Jones CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  2. Overview • Chapter 3 is about using Toolbox controls in Visual Studio .NET. • TextBox • Button • CheckBox • RadioButton • ListBox • ComboBox • DateTimePicker • LinkLabel CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  3. TextBox The TextBox control provides a way for your program to get text input from the user. He simply types text in the textbox. The text entered by the user is stored in the Text property of the Textbox. You can access it as follows TextBox1.Text CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  4. Example – Ch. 1 This event procedure contains code that will be executed when the user clicks the Answer button at run-time. CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  5. Button The Button control provides a way for your program to get click input from the user. He simply clicks a button when he wants to initiate some response from the program. The text displayed inside the button is stored in the Text property of the Button, which is usually defined by the programmer through the Properties window at design time. When the user clicks the button at runtime, the corresponding event procedure is invoked, which will perform the actions associated with the button. By default, the name of the event procedure is the concatenation of the name of the button with the string “_Click”, e.g. Button1_Click() for Button1. CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  6. CheckBox The CheckBox control provides a way for your program to get on/off input from the user. The checkbox is a toggle switch; the user clicks in the checkbox to turn it off or on. A group of checkboxes allows the user to select zero or more choices from the group. Selection of one checkbox of a group is independent of the other checkboxes (see radio buttons for contrast). The CheckedState property stores the on/off state of the checkbox. If the user has checked the checkbox, CheckedState = True; otherwise, it is False. You can access the CheckedState property as follows: CheckBox1.CheckedState CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  7. RadioButton The RadioButton control provides a way for your program to get on/off input from the user. The radio button is a toggle switch; the user clicks in the radio button to turn it off or on. A group of radio buttons allows the user to select exactly one choice from the group. The difference between the behavior of a radio button and a checkbox is that when the user clicks a radio button, all other radio buttons in the same group are turned off. The CheckedState property stores the on/off state of the radio button. If the user has selected the radio button, CheckedState = True; otherwise, it is False. You can access the CheckedState property as follows: RadioButton1.CheckedState CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  8. ListBox The ListBox control provides a way for your program to allow the user to choose an item from a list. He simply clicks on the item in the ListBox to select it. All items in the list box appear on the form. The SelectedIndex property of the list box stores the index of the list item that was selected by the user. ListBox1.SelectedIndex SelectedIndex counting starts at 0. For example, say we have a list of five items: US Dollar, Saudi Riyal, British Pound, Japanese Yen, and Euro. Each item would have indices 0, 1, 2, 3, and 4, respectively. For example, if the user selects British Pound, the SelectedIndex property of the ListBox would be set to 2. CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  9. ComboBox The ComboBox control provides a way for the user to select an item from a list. It’s very similar to a ListBox, except that the whole list is not displayed directly on the form. Instead, the list is only displayed when the user clicks the drop-down arrow. Once the user makes his selection, the selection is displayed in the combo box on the form. For this reason, the combo box is also called a drop-down listbox. The combo box also has a SelectedIndex property, which stores the index of the selected item. CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  10. DateTimePicker The TextBox control provides a way for your program to get text input from the user. He simply types text in the textbox. The text entered by the user is stored in the Text property of the Textbox. You can access it as follows TextBox1.Text CA 121 Intro to Programming Tariq Aziz and Kevin Jones

  11. LinkLabel The TextBox control provides a way for your program to get text input from the user. He simply types text in the textbox. The text entered by the user is stored in the Text property of the Textbox. You can access it as follows TextBox1.Text CA 121 Intro to Programming Tariq Aziz and Kevin Jones

More Related