public void LangLoade() { LangLoader.Default(); var it = (ToolStripMenuItem)menuStrip1.Items["langToolStripMenuItem"]; foreach (var file in Directory.GetFiles(Path.Combine(Directory.GetCurrentDirectory(), "languages"))) { var item = new ToolStripMenuItem(); item.Name = Path.GetFileName(file); item.Text = Path.GetFileName(file); item.Click += item_Click; it.DropDownItems.Add(item); } }
private void button3_Click(object sender, EventArgs e) { for (int i = 0; i <= 3; i++) { menuStrip1.Items[i].Text = LangLoader.GetLangItem("MenuItem" + (i + 1)); } var it = (ToolStripMenuItem)menuStrip1.Items[0]; for (int i = 0; i < it.DropDownItems.Count; i++) { it.DropDownItems[i].Text = LangLoader.GetLangItem("Menu1SubItem" + (i + 1)); } }
void listBox1_MouseClick(object sender, MouseEventArgs e) { if (SelectedIndex == -1) { return; } if (e.Button == MouseButtons.Right) { ContextMenuStrip m = new ContextMenuStrip(); for (int i = 0; i < 3; i++) { m.Items.Add(LangLoader.GetLangItem("ContextMenu" + i)); } m.Show(listBox1, new Point(e.X, e.Y)); m.ItemClicked += m_ItemClicked; } }
public Form1() { InitializeComponent(); dataGridView1.AutoGenerateColumns = false; dataGridView1.AllowUserToAddRows = false; var column0 = new DataGridViewTextBoxColumn() { Name = "Test", HeaderText = "header", Width = 165 }; dataGridView1.Columns.Add(column0); var priva = dataGridView1.Columns["Test"]; if (priva != null) { priva.ReadOnly = true; } var column = new DataGridViewTextBoxColumn() { Name = "Value", HeaderText = LangLoader.GetLangItem("GridValues"), Width = 165 }; var column1 = new DataGridViewTextBoxColumn() { Name = "Decrypt", HeaderText = LangLoader.GetLangItem("GridDecrypt"), Width = 100 }; dataGridView1.Columns.Add(column); dataGridView1.Columns.Add(column1); Helper.LoadSurfaces(); listBox1.SelectionMode = SelectionMode.MultiExtended; listBox1.MouseDown += listBox1_MouseClick; numericUpDown1.Maximum = int.MaxValue; numericUpDown1.Minimum = 0; textBox3.MouseDoubleClick += textBox3_MouseDoubleClick; LoadDicts(); Helper.LoadElementConfigs(); CheckForIllegalCrossThreadCalls = false; LangLoade(); }