0
我在組合框中創建了一個字體列表。我設置它的DrawMode到OwnerDrawFixed和方法DRAWITEM很簡單:c#combobox DrawItem - 刷新問題
void cmbFonts_DrawItem(object sender, DrawItemEventArgs e)
{
if (e.Index < 0) return;
e.DrawBackground();
Font newFont =
new Font(cmbFonts.Items[e.Index].ToString(), this.DefaultFontSize);
e.Graphics.DrawString(cmbFonts.Items[e.Index].ToString(),
newFont,
new SolidBrush(Color.Black),
new Rectangle(e.Bounds.Location, e.Bounds.Size));
e.DrawFocusRectangle();
}
在gerneral,它工作正常。問題出現在鼠標滾動上。然後有些項目看起來像隨機圖形,直到他們專注。任何人都知道問題的解決方案?
感謝您發佈,但它沒有幫助:\ \ – Ray 2012-04-19 08:40:09