如何让combox控件点击后 其下窗口多显示几行内容???谢谢

解决方案 »

  1.   

    combox控件当点击时,下面弹出列表,我的列表中数据很多,如何一次能多显示几行?
      

  2.   

    1.combo必须画在窗体上而不是picture等容器里
    2.窗体的scalemde要是twips   Option Explicit
        
      Private Declare Function MoveWindow Lib "user32" _
          (ByVal hwnd As Long, ByVal x As Long, ByVal y As _
          Long, ByVal nWidth As Long, ByVal nHeight As Long, _
          ByVal bRepaint As Long) As Long
            
    Public Function SetComboBoxHeight(objCB As ComboBox, _
          TheHeight As Single) As Boolean
      On Error Resume Next
      Dim lHeight     As Single
      lHeight = TheHeight * 1440           'inches   to   pixels
      lHeight = lHeight / Screen.TwipsPerPixelY
      Me.ScaleMode = vbPixels
      With objCB
              MoveWindow .hwnd, .Left, .Top, .Width, lHeight, 1
      End With
      Me.ScaleMode = vbTwips
        
      SetComboBoxHeight = Err.Number = 0 And Err.LastDllError = 0
        
        
      End FunctionPrivate Sub Form_Load()
    Dim i As Integer
    For i = 0 To 36
        Combo1.AddItem "list" & i
    Next i
    SetComboBoxHeight Combo1, 2
    End Sub
      

  3.   

    Combo1.AddItem "MINGZI"
     Combo1.AddItem "****"
     Combo1.AddItem "11111111"