2016-07-22 55 views
2

组合框有一个ComboBoxState,它可以是普通残疾人,或ComboBox是什么意思是“热”?

前三个似乎很明显,但什么是“热”?

+0

[VisualStyleElement.ComboBox.DropDownButton.Hot性](https://msdn.microsoft.com/en-us/library /system.windows.forms.visualstyles.visualstyleelement.combobox.dropdownbutton.hot(v=vs.110).aspx) – Fabio

+0

您可以关注此链接:http://stackoverflow.com/questions/36287605/hot-tracking-list -item-selection-in-a-combo-box希望它会有帮助。 –

+0

但是这个“热门国家”是什么?它是什么样子的? – Athena

回答

1

这是当鼠标在控制:

protected override void OnPaint(PaintEventArgs e) { 
    int top = 16; 
    foreach (ComboBoxState cbs in new ComboBoxState[] { ComboBoxState.Normal, 
                 ComboBoxState.Disabled, 
                 ComboBoxState.Pressed, 
                 ComboBoxState.Hot}) { 
    Rectangle r = new Rectangle(16, top, 84, 21); 
    ComboBoxRenderer.DrawTextBox(e.Graphics, r, cbs); 
    TextRenderer.DrawText(e.Graphics, cbs.ToString(), this.Font, r, Color.Black); 
    ComboBoxRenderer.DrawDropDownButton(e.Graphics, 
             new Rectangle(16 + 84, top, 21, 21), cbs); 
    top += 23; 
    } 
} 

enter image description here

+0

啊,我明白了。完善。谢谢! – Athena