不知有没有一种类似ComBox的第三方控件!
  可以实现把鼠标放在控件上则自动把下拉框展开;
当用鼠标一点击时,则选中。

解决方案 »

  1.   

    uses Math;procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
      var Handled: Boolean);
    var
      vRect: TRect;
    begin
      case Msg.message of
        WM_MOUSEMOVE: begin
          vRect := ComboBox1.BoundsRect;
          if ComboBox1.DroppedDown then
            vRect.Bottom := vRect.Bottom +
              Min(ComboBox1.DropDownCount, ComboBox1.Items.Count + 1) *
              ComboBox1.ItemHeight;
          if PtInRect(vRect, ScreenToClient(Mouse.CursorPos)) then
            if not ComboBox1.DroppedDown then
              ComboBox1.DroppedDown := True
            else
          else if ComboBox1.DroppedDown then
            ComboBox1.DroppedDown := False;
        end;
      end;
    end;
      

  2.   

    object ComboBox1: TComboBox
      Left = 32
      Top = 88
      Width = 145
      Height = 21
      ItemHeight = 13
      TabOrder = 0
      Text = 'ComboBox1'
      Items.Strings = (
        'Line.1'
        'Line.2'
        'Line.3')
    end
    object ApplicationEvents1: TApplicationEvents
      OnMessage = ApplicationEvents1Message
      Left = 80
      Top = 32
    end