Hi...!
i'm working on dictionary project and i want to know how can i get the value of a dictionary<string,string> by it's key?! i want to show it on a text field! thanks...!
this is the code that you add word and it's translate but i don't know how to show it's value by key...!
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Dictionary<string, string> dic = new Dictionary<string, string>();
private void Form1_Load(object sender, EventArgs e)
{
this.Text = "Dictionary";
txtWordforTranslate.Enabled = false;
}
private void btnAdd_Click(object sender, EventArgs e)
{
if ("".Equals(txtWord.Text) || "".Equals(txtTranslateWord.Text))
{
DialogResult d = MessageBox.Show("Please Fill The Blank Fields!", "Blank Field Error!", MessageBoxButtons.OK);
txtWordforTranslate.Enabled = false;
}
if (!"".Equals(txtWord.Text) && !"".Equals(txtTranslateWord.Text))
{
txtWordforTranslate.Enabled = true;
dic.Add(txtTranslateWord.Text,txtWord.Text);
}
}
private void btnTranslate_Click(object sender, EventArgs e)
{
}
}