BF2Statistics.GamespyRedirectForm.SetHostStatus C# (CSharp) Method

SetHostStatus() private method

Fills in the details of a Hosts(Ics) tab progress step on the GUI
private SetHostStatus ( int i, string ImgText, Bitmap Img ) : void
i int The picturebox id
ImgText string The tooltip message for this step image
Img System.Drawing.Bitmap The image to set
return void
        private void SetHostStatus(int i, string ImgText, Bitmap Img)
        {
            // Prevent exception
            if (!IsHandleCreated) return;

            // Fetch the picture box for this step
            Control[] cons = this.Controls.Find("pictureBox" + i, true);
            PictureBox pic = cons[0] as PictureBox;

            // Set the new image
            pic.Image = Img;

            // Set the tooltip for the image control if we have one
            if (!String.IsNullOrWhiteSpace(ImgText))
                Tipsy.SetToolTip(pic, ImgText);
        }