ComboBox“热”是什么意思?

时间:2016-07-22 16:13:56

标签: winforms combobox

组合框有一个ComboBoxState,可以是普通已禁用已按下

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

1 个答案:

答案 0 :(得分: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