public void f06_MySQLKomutCalistir_Load(object sender, EventArgs e) { LVw_Log_Kur(); SunucuAdi_Lbl.Text = BaglantiAdi; FormTextleriDegistir(sender, e); Btn_Genislet.BackColor = Color.Silver; dilSeciciKontrol1.button1.Click += FormTextleriDegistir; dilSeciciKontrol1.button2.Click += FormTextleriDegistir; cikisButon1.CikiButonButtonClicked += Cikis; RenklenecekKomutlar = mySQLYonet.IstekKomutlar(); CBox_VeriTabanlariniDoldur(); TSMI_Yapistir.Enabled = false; //TabloDuzenleAcKapa(); }
private void Btn_RenkliKomutlar_Click(object sender, EventArgs e) { MySQLYonet mySQLYonet = new MySQLYonet(); string[] komutlar = mySQLYonet.IstekKomutlar(); Array.Sort(komutlar); int i = 0; RTBox_Komutlar.Text = ""; foreach (string komut in komutlar) { RTBox_Komutlar.Text += "dizi[" + i.ToString() + "] = \"" + komut + "\";\r\n"; i++; } foreach (string komut in komutlar) { //[ renklendir if (RTBox_Komutlar.Text.Contains(komut)) { int index = -1; int selectStart = RTBox_Komutlar.SelectionStart; while ((index = RTBox_Komutlar.Text.IndexOf(komut, (index + 1))) != -1 || (index = RTBox_Komutlar.Text.IndexOf(komut.ToUpper(), (index + 1))) != -1 ) { this.RTBox_Komutlar.Select((index + 0), komut.Length); this.RTBox_Komutlar.SelectionColor = Color.Aqua; //this.RTBox_Komutlar.Select(selectStart, 0); this.RTBox_Komutlar.SelectionColor = Color.Blue; } } // renklendir ] } OrtakSinif.RTBox_Renklendir(komutlar, richTextBox1); }