help me solve this problem ? please ...
-
hi all, i have a function like this in my form1.cs: public void SendAll(string str) { for (int i = 0; i < Soketler.Count; ++i) { if (((Socket)Soketler[i]).Connected) { ns = new NetworkStream(((Socket)Soketler[i])); sw = new StreamWriter(ns); sw.WriteLine(str); string[] dataread = new string[3]; char[] splitter = { ' ' }; dataread = str.Split(splitter); txtOdaNo.Text = dataread[0].ToString(); txtKiraBaslangic.Text = dataread[1].ToString(); txtKiraBitis.Text = dataread[2].ToString(); cmbCOSaati.Text = "12:00"; button12_Click(sender, e); MessageBox.Show("Kiralama Kodunuz!!!\n\n Ciktisini Almak Ister Misiniz ?"," Kira Kodu Bilgisi",MessageBoxButtons.YesNo,MessageBoxIcon.Information); sw.Flush(); } } } bold line represent a button on my form. i have a user interface and some textboxes. these boxes may be filled both manually by typing from keyboard or they can be send via tcp/ip as a string with " " (a space) in each data. then i parse the string according to that space and assign each value to the corresponding textboxes. the problem is this: if user fill datas manually, s/he can easily press the button12 to run it. but if datas were send via tcp/ip and textboxes filled by parsing, button12_click(sender,e); doesnt work in my function :( i get these errors: > the name 'sender' does not exist in the current context. > the name 'e' does not exist in the current context. how can i solve this problem and make button12_click work in my function as well ? help please, thanks in advance, bye.
-
hi all, i have a function like this in my form1.cs: public void SendAll(string str) { for (int i = 0; i < Soketler.Count; ++i) { if (((Socket)Soketler[i]).Connected) { ns = new NetworkStream(((Socket)Soketler[i])); sw = new StreamWriter(ns); sw.WriteLine(str); string[] dataread = new string[3]; char[] splitter = { ' ' }; dataread = str.Split(splitter); txtOdaNo.Text = dataread[0].ToString(); txtKiraBaslangic.Text = dataread[1].ToString(); txtKiraBitis.Text = dataread[2].ToString(); cmbCOSaati.Text = "12:00"; button12_Click(sender, e); MessageBox.Show("Kiralama Kodunuz!!!\n\n Ciktisini Almak Ister Misiniz ?"," Kira Kodu Bilgisi",MessageBoxButtons.YesNo,MessageBoxIcon.Information); sw.Flush(); } } } bold line represent a button on my form. i have a user interface and some textboxes. these boxes may be filled both manually by typing from keyboard or they can be send via tcp/ip as a string with " " (a space) in each data. then i parse the string according to that space and assign each value to the corresponding textboxes. the problem is this: if user fill datas manually, s/he can easily press the button12 to run it. but if datas were send via tcp/ip and textboxes filled by parsing, button12_click(sender,e); doesnt work in my function :( i get these errors: > the name 'sender' does not exist in the current context. > the name 'e' does not exist in the current context. how can i solve this problem and make button12_click work in my function as well ? help please, thanks in advance, bye.
The following should work:
button12_Click(this.button12, new EventArgs());
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
The following should work:
button12_Click(this.button12, new EventArgs());
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
hi all, i have a function like this in my form1.cs: public void SendAll(string str) { for (int i = 0; i < Soketler.Count; ++i) { if (((Socket)Soketler[i]).Connected) { ns = new NetworkStream(((Socket)Soketler[i])); sw = new StreamWriter(ns); sw.WriteLine(str); string[] dataread = new string[3]; char[] splitter = { ' ' }; dataread = str.Split(splitter); txtOdaNo.Text = dataread[0].ToString(); txtKiraBaslangic.Text = dataread[1].ToString(); txtKiraBitis.Text = dataread[2].ToString(); cmbCOSaati.Text = "12:00"; button12_Click(sender, e); MessageBox.Show("Kiralama Kodunuz!!!\n\n Ciktisini Almak Ister Misiniz ?"," Kira Kodu Bilgisi",MessageBoxButtons.YesNo,MessageBoxIcon.Information); sw.Flush(); } } } bold line represent a button on my form. i have a user interface and some textboxes. these boxes may be filled both manually by typing from keyboard or they can be send via tcp/ip as a string with " " (a space) in each data. then i parse the string according to that space and assign each value to the corresponding textboxes. the problem is this: if user fill datas manually, s/he can easily press the button12 to run it. but if datas were send via tcp/ip and textboxes filled by parsing, button12_click(sender,e); doesnt work in my function :( i get these errors: > the name 'sender' does not exist in the current context. > the name 'e' does not exist in the current context. how can i solve this problem and make button12_click work in my function as well ? help please, thanks in advance, bye.
button12.PerformClick();
Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour -
The following should work:
button12_Click(this.button12, new EventArgs());
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
Even better:
button12_Click(this.button12, EventArgs.Empty);