I have image Listbox Item Custom.Problem here.I can't click event picture inside Item ListBox.Help me.Thanks All.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Krishna Rajput SinghRank #605 · 4K reputationPosted Jan 27, 2016, 8:42 AM EST
Hi phong thanks for writing below codes i hope helpfulf or you..:)
namespace WindowsFormsApplication11 { public partial class Form1 : Form { List _items = new List();
public Form1() { InitializeComponent(); _items.Add("One"); _items.Add("Two"); _items.Add("Three"); listBox1.DataSource = _items; } private void button1_Click(object sender, EventArgs e) { // The Add button was clicked. _items.Add("New item " + DateTime.Now.Second); // Change the DataSource. listBox1.DataSource = null; listBox1.DataSource = _items; } private void button2_Click(object sender, EventArgs e) { // The Remove button was clicked. int selectedIndex = listBox1.SelectedIndex; try { // Remove the item in the List. _items.RemoveAt(selectedIndex); } catch { } listBox1.DataSource = null; listBox1.DataSource = _items; } }}
private void button1_Click(object sender, EventArgs e) { // The Add button was clicked. // ...
}
private void button2_Click(object sender, EventArgs e) { // The Remove button was clicked. // ....
}
phong dinh15 reputationPosted Jan 27, 2016, 3:31 PM EST