Hi guys i'd really appreciate your help in this one. I have been trying this for so long with only bad results.
Here is my code:
So what I am trying to do is to get textBox1 to show which button i have clicked. Because I have Form_Activated I only see changes when i reactivate the Form. So I would like to have Event that is Active all the time and listens to everything that happens in Application and NOT only when something is clicked or some text have changed.
Thanks in advance.
Here is my code:
VB.NET:
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
double z;
public Form1()
{
InitializeComponent();
}
private void Form1_Activated(object sender, EventArgs e)
{
if (z == 1)
{
textBox1.Text = ("Button1 clicked");
}
else
{
textBox1.Text = ("Button2 clicked");
}
}
private void button1_Click(object sender, EventArgs e)
{
z = 1;
}
private void button2_Click(object sender, EventArgs e)
{
z = 2;
}
}
}
So what I am trying to do is to get textBox1 to show which button i have clicked. Because I have Form_Activated I only see changes when i reactivate the Form. So I would like to have Event that is Active all the time and listens to everything that happens in Application and NOT only when something is clicked or some text have changed.
Thanks in advance.