CSPspEmu.Gui.Winforms.FunctionViewerForm.PcListBox_DrawItem_1 C# (CSharp) Method

PcListBox_DrawItem_1() private method

private PcListBox_DrawItem_1 ( object sender, DrawItemEventArgs e ) : void
sender object
e System.Windows.Forms.DrawItemEventArgs
return void
        private void PcListBox_DrawItem_1(object sender, DrawItemEventArgs e)
        {
            e.DrawBackground();
            e.DrawFocusRectangle();

            if (e.Index >= 0)
            {
                var ListBox = (ListBox)sender;
                var item = ListBox.Items[e.Index] as PCItem;

                var Color = item.ItemColor;

                if (item == ListBox.SelectedItem)
                {
                    //Color = SystemColors.HighlightText;
                }

                e.Graphics.DrawString(
                    item.ToString(),
                    ListBox.Font,
                    new SolidBrush(Color),
                    e.Bounds
                );
            }
        }