组合框有一个ComboBoxState,可以是普通,已禁用,已按下或热
前三个似乎很明显,但什么是“热门”?
答案 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;
}
}