Ovo ti treba :)
Kod u formi sa koje zelis da pozoves:
Code:
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
switch ((int)e.KeyChar)
{
case 42:// *
case 43:// +
case 45:// -
Form2 nova = new Form2();
nova.Parametar = e.KeyChar;
nova.ShowDialog();
break;
}
}
Kod u formi koju pozivas:
Code:
public Form2()
{
InitializeComponent();
}
public char Parametar; // ovde deklarises Pulic promenljivu na nivou cele forme
private void Form2_Load(object sender, EventArgs e)
{
label2.Text = Parametar.ToString();
}
E sad ja sam ovde samo ispisao koje je dugme pritisnuto, dok ti mozes da odradis odredjena setovanja na formi u zavisnosti koji taster je stisnut :)
Shoot for the moon. Even if you miss, you'll land among the stars.
Les Brown