using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace keyPressed { public partial class Form1 : Form { string str = "hellow"; public Form1() { InitializeComponent(); pp(); } private void pp() { //I need to call button1_Click from here //without using the mouse ,how could i do that ? } private void button1_Click(object sender, EventArgs e) { MessageBox.Show(str); } } }
private void button1_Click(object sender, EventArgs e) { button2.PerformClick(); } private void button2_Click(object sender, EventArgs e) { MessageBox.Show("Hello"); }
private void pp() { //I need to call button1_Click from here //without using the mouse ,how could i do that ? button1_Click(this, new EventArgs()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)