2016-07-22 27 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