VAGSuite.frmBinCompare.listBox2_DrawItem C# (CSharp) Метод

listBox2_DrawItem() приватный Метод

private listBox2_DrawItem ( object sender, DrawItemEventArgs e ) : void
sender object
e System.Windows.Forms.DrawItemEventArgs
Результат void
        private void listBox2_DrawItem(object sender, DrawItemEventArgs e)
        {
            /*e.DrawBackground();
            e.DrawFocusRectangle();
            if (e.Index < 0) return;
            if (e.Index < listBox1.Items.Count)
            {
                if (!checkButton1.Checked)
                {
                    if (linediffs[e.Index]) e.Graphics.DrawString(listBox2.Items[e.Index].ToString(), listBox2.Font, Brushes.Red, e.Bounds);
                    else e.Graphics.DrawString(listBox2.Items[e.Index].ToString(), listBox2.Font, Brushes.Black, e.Bounds);
                }
                else
                {
                    e.Graphics.DrawString(listBox2.Items[e.Index].ToString(), listBox2.Font, Brushes.Black, e.Bounds);
                }
            }*/
            try
            {
                if (!checkButton1.Checked)
                {
                    if (linediffs[e.Index]) listBox2.DefaultDrawItem(e, compstrList[e.Index], Brushes.Red);
                    else listBox2.DefaultDrawItem(e, compstrList[e.Index], Brushes.Black);
                }
                else
                {
                    listBox2.DefaultDrawItem(e, compstrList[e.Index], Brushes.Black);
                }
            }
            catch (Exception)
            {
            }
        }