Get text windows to populate

This commit is contained in:
Tim Young 2017-10-03 15:32:16 -05:00
parent 3373c325b3
commit 50452f4ea2
2 changed files with 51 additions and 0 deletions

View File

@ -43,6 +43,7 @@
this.cb1Language.Name = "cb1Language";
this.cb1Language.Size = new System.Drawing.Size(121, 24);
this.cb1Language.TabIndex = 0;
this.cb1Language.SelectedIndexChanged += new System.EventHandler(this.cb1Language_SelectedIndexChanged);
//
// tb1Message
//
@ -51,6 +52,7 @@
this.tb1Message.Name = "tb1Message";
this.tb1Message.Size = new System.Drawing.Size(400, 181);
this.tb1Message.TabIndex = 10;
this.tb1Message.Leave += new System.EventHandler(this.tb1Message_Leave);
//
// tb2Message
//
@ -59,6 +61,7 @@
this.tb2Message.Name = "tb2Message";
this.tb2Message.Size = new System.Drawing.Size(400, 181);
this.tb2Message.TabIndex = 12;
this.tb2Message.Leave += new System.EventHandler(this.tb2Message_Leave);
//
// cb2Language
//
@ -67,6 +70,7 @@
this.cb2Language.Name = "cb2Language";
this.cb2Language.Size = new System.Drawing.Size(121, 24);
this.cb2Language.TabIndex = 11;
this.cb2Language.SelectedIndexChanged += new System.EventHandler(this.cb2Language_SelectedIndexChanged);
//
// btnClose
//

View File

@ -64,6 +64,25 @@ namespace EduNetworkBuilder
mySettings.Save();
}
string CodeFromLang(string language)
{
string[,] LanguageChoices = NB.LanguageChoices;
for (int i = 0; i < LanguageChoices.GetLength(0); i++)
{
if (language == LanguageChoices[i, 0]) return LanguageChoices[i, 1];
}
return "";
}
string LangFromCode(string Code)
{
string[,] LanguageChoices = NB.LanguageChoices;
for (int i = 0; i < LanguageChoices.GetLength(0); i++)
{
if (Code == LanguageChoices[i, 1]) return LanguageChoices[i, 0];
}
return "";
}
private void btnClose_Click(object sender, EventArgs e)
{
Close();
@ -87,5 +106,33 @@ namespace EduNetworkBuilder
{
ClosingStuff();
}
private void cb1Language_SelectedIndexChanged(object sender, EventArgs e)
{
string What = CodeFromLang(cb1Language.Text);
if (What != "")
{
tb1Message.Text = myNet.NetMessage.GetText(What);
}
}
private void cb2Language_SelectedIndexChanged(object sender, EventArgs e)
{
string What = CodeFromLang(cb2Language.Text);
if (What != "")
{
tb2Message.Text = myNet.NetMessage.GetText(What);
}
}
private void tb1Message_Leave(object sender, EventArgs e)
{
}
private void tb2Message_Leave(object sender, EventArgs e)
{
}
}
}