Transcript

IN VISUAL STUDIO 2010

TOOLBOX

Listbox

ComboBox

Checkbox

Radio Button

PictureBox and GroupBox

LISTBOX

Displays a list which the user can select items.

Default name: ListBox1

SAMPLE FORM:

CODES:

Add Button:ListBox1.Items.Add(TextBox1.Text)TextBox1.Text = "“

Remove:ListBox1.Items.Clear()

Exit:Me.Close()

COMBOBOX

•Displays an editable textbox with a dropdown list of permitted values.

•Default name: ComboBox1

CODES:If ComboBox1.SelectedItem =

"Jedrick Baylon" Then TextBox1.Text = "4th Year - Humility"

Else If ComboBox1.SelectedItem = "Aldrin Dela Cruz" Then TextBox1.Text = "4th Year - Chastity“

Else If ComboBox1.SelectedItem = "Christian Valino" Then TextBox1.Text = "4th Year - Love"

Else If ComboBox1.SelectedItem = "Angelica Manliclic" Then TextBox1.Text = "4th Year - Simplicity"

CHECKBOX

•Enables the user to select or clear the associated option.

•Let the user select ZERO or MORE options of a limited number of choices.

•Default name: Checkbox1

SAMPLE FORM:

CODES:If CheckBox1.Checked = True Then MsgBox("P3,000.00", , "Price") End If If CheckBox2.Checked = True Then MsgBox("4,999.00", , "Price") End If If CheckBox3.Checked = True Then MsgBox("P8,600.00", , "Price") End If If CheckBox4.Checked = True Then MsgBox("P25,000.00", , "Price") End If If CheckBox5.Checked = True Then MsgBox("P15,888.00", , "Price") End If

RADIO BUTTON• Enables the user to select a single option

from a group of choices when paired with other RadioButtons.

• Radio buttons are like checkboxes except that when several share the same control name, they are mutually exclusive: when one is switched "on", all others with the same name are switched "off".

• Default name: RadioButtons1

PICTUREBOX AND GROUPBOX

PictureBox• Displays an image.• Default name: PictureBox

GroupBox• Displays a frame around a group of controls

with an optional caption.• Default name: GroupBox1

SAMPLE FORM:

PROPERTIES• Image – The image will display in the PictureBox•Size Mode – (Normal, StretchImage, AutoSize, CenterImage, Zoom) Controls how the PictureBox will handle image placementand control sizing.• Visible – Determine whether the control is visible or hiddent

CODES:Public Class Form1

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged PictureBox1.Image = My.Resources.charm_bracelet label1.text = "P400.00" End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged PictureBox1.Image = My.Resources.crystal_bracelet Label1.Text = "P350.00" End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged PictureBox1.Image = My.Resources.owl_bracelet Label1.Text = "P500.00" End Sub

Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged PictureBox1.Image = My.Resources.ruby_bracelet Label1.Text = "P450.00" End Sub

top related