So I have a C# program that take the user input and sends it out to another function.
The problem I'm having is that it only works the first time I click on button1, then I have to re-run the program so I can send out anything else.
I'm not sure what's the problem here.
Code:
public Form1()
{
int i;
InitializeComponent();
InitComPort1();
readDevice();
i = ReadDevice();
textBox3.Text = ReadString(2);
}
private void button1_Click_1(object sender, EventArgs e)
{
int i;
string DS = "DS";
string DS_Rev = textBox2.Text;
string DS_SN = textBox1.Text;
string DS_Type = comboBox1.Text;
string DS_Pdate = DateTime.Now.ToString("MMyy");
i = ProgramDevice(3, DS + DS_SN + DS_Type, DS_Pdate + DS_Rev);
if (i == 1)
{
MessageBox.Show(DS + DS_SN + DS_Type + DS_Pdate + DS_Rev + " Programmed Succesfully", "Programmer Result");
}