problem with while loop

Hello everyone ,I faced this problem and I tried to fixe it but I couldind please I need your help .. this is my code:
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

y=Convert::ToInt16(textBox1->Text);
c=Convert::ToInt16(textBox3->Text);
a=Convert::ToDouble(rand() % y);
b=Convert::ToDouble(rand() % c);
textBox2->Text = Convert::ToString(a);
textBox4->Text = Convert::ToString(b);

x1=0;
x2=0;

do
{
trafficlight(a,b,1,2);
}while(i==0);//here is my problem i need condition to make the while loop working while the program is running


if I do click on the button it jumps to the while loop only without the previous code and I need the previous code to work and condition that makes the while loop working while the program is running ..
Topic archived. No new replies allowed.