Ask a Teacher



write a program in visual basic to create a form for the sports teachers which involves all students to choose their favorite sports


Enter the program code :


private sub Form_Load(object sender, System.EventArgs e)
{    
    DropDownList1.Items.Add("Cricket");
    DropDownList1.Items.Add("Football");
}

private void button1_Click(object sender, System.EventArgs e)
{
    listBox1.Items.Add(Textbox1.Text + "\t" + DropDownList1.SelectedItem.Value);
}



comments powered by Disqus