sara.sherafati
دوشنبه 20 شهریور 1391, 15:41 عصر
n = listBox1.Items(listBox1.SelectedIndex).Tostring();
به itemsارور میده و نمیدونم چرا
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace test3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string n;
string m = "";
n = listBox1.Items(listBox1.SelectedIndex).Tostring();
switch (n)
{
case "sara":
m = "yellow";
break;
case"masood":
m = "blue";
break;
case "hasan":
m = "Morning Mist";
break;
case "sahar":
m = "dokhi amoo";
break;
case"reza":
m = "name of boy";
break;
case"roya":
m = "name of girl";
default:
break;
}
MessageBox.Show(n+"chizi k bayad gofte she"+ m, "select demo");
}
}
}
به itemsارور میده و نمیدونم چرا
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace test3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string n;
string m = "";
n = listBox1.Items(listBox1.SelectedIndex).Tostring();
switch (n)
{
case "sara":
m = "yellow";
break;
case"masood":
m = "blue";
break;
case "hasan":
m = "Morning Mist";
break;
case "sahar":
m = "dokhi amoo";
break;
case"reza":
m = "name of boy";
break;
case"roya":
m = "name of girl";
default:
break;
}
MessageBox.Show(n+"chizi k bayad gofte she"+ m, "select demo");
}
}
}