Cheat Sheet Exam 2

Cheat Sheet Exam 2 - Checks to see if already in list For i...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Checks to see if already in list: For i = 0 to lstToDos.Items.Count – 1 If lstToDos.Items(i).ToString.ToUpper = txtAdd.Text.ToUpper then MessageBox.Show(“Item already in list”) Exit Sub End If Radio Button radMedium.Checked=True Event triggered when user selects a rad.button Private sub radM_CheckedChanged(. .. Double click on rad.button to created this event Check Boxes Text next to the checkbox: chkPepperoni.Text = “Pepperoni” Check for true chkPepperoni.Checked = “True” List Box (lst) Use collections property to determine what options are there Add items @ runtime using the add method for items property lstReservations.Items.Add(strNewTime) strNewTime is the string appended to the Items property of the listbox Items index start at 0 How to assign Selected value to a variable: strReservations = lstReservations.SelectedItem Selected Index contains the number of the selected item strReservations = lstReservations.Items(lstReservations.SelectedIndex) SelectedIndex = -1 when no item is selected Use the count method to find the #’s of items I the list shoCount = lstReservations.Items.Count Insert Item lstReservations.Items.Insert(shoIndex, strItem) Removing Items (2 ways) lstReservations.Items.Remove(“9:00”) //searches for value lstReservations.Items.RemoveAt(0) //searches for Index Clear the list Box lstReservations.Items.Clear() Sort List box Either set property ‘Sorted’ to true, or use lstReservations.Sorted = True code ComboBox: cbo.SelectedIndex, cbo.SelectedItem Data Validation If strFavorite = “” Then MsgBox.Show() shoItemNum = lstToDo.SelectedIndex If shoItemNum = -1 Then , MsgBox() DropDownList looks like a DropDown but the user cannot items to it
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

Cheat Sheet Exam 2 - Checks to see if already in list For i...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online