private void SetStatus(int i, string address, Bitmap Img, string ImgText = "")
{
// Prevent exception
if (!IsHandleCreated) return;
// Invoke this in the thread that created the handle
Invoke((Action)delegate
{
switch (i)
{
case 0:
Address1.Text = address;
Status1.Image = Img;
Tipsy.SetToolTip(Status1, ImgText);
break;
case 1:
Address2.Text = address;
Status2.Image = Img;
Tipsy.SetToolTip(Status2, ImgText);
break;
case 2:
Address4.Text = address;
Status4.Image = Img;
Tipsy.SetToolTip(Status4, ImgText);
break;
case 3:
Address5.Text = address;
Status5.Image = Img;
Tipsy.SetToolTip(Status5, ImgText);
break;
}
});
}