Пример #1
0
 void CustomCheckedComboBoxEdit_DrawItem(object sender, ListBoxDrawItemEventArgs e)
 {
     if (listBoxControl != null && Properties.CheckStyle != DevExpress.XtraEditors.Controls.CheckStyles.Standard)
     {
         CheckedListBoxControl  lbControl = sender as CheckedListBoxControl;
         CheckedListBoxViewInfo vi        = lbControl.GetViewInfo() as CheckedListBoxViewInfo;
         CheckedListBoxViewInfo.CheckedItemInfo checkItemInfo = vi.GetItemByIndex(e.Index) as CheckedListBoxViewInfo.CheckedItemInfo;
         checkItemInfo.CheckArgs.CheckStyle = Properties.CheckStyle;
         if (Properties.CheckStyle == DevExpress.XtraEditors.Controls.CheckStyles.Radio)
         {
             return;
         }
         SetProperties(checkItemInfo);
     }
 }
        void OnDrawItem(object sender, ListBoxDrawItemEventArgs e)
        {
            if (e.Index == 0)
            {
                return;
            }
            listBox = sender as CheckedListBoxControl;
            CheckedListBoxViewInfo viewInfo = listBox.GetViewInfo() as CheckedListBoxViewInfo;
            Image image = Properties.GetItemImage(e.Index - 1);

            if (image == null)
            {
                return;
            }
            DrawCheckedItem(e, viewInfo, image);
            e.Handled = true;
        }