Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ComboBox pulldown list

Posted on 1998-07-31
5
Medium Priority
?
200 Views
Last Modified: 2010-05-03
I'm finding a way to have a longer pulldown list of the combo box.  
Could anybody tell me how to do this ?
0
Comment
Question by:tam031198
  • 3
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 120 total points
ID: 1467366
Sure, this is worth more than 30 points, but here you go:

public sub DropDownHeight(m_cbo as combobox, sHeight As Single)
    Dim sItemWidth      As Single
    Dim sItemWHeight    As Single
    Dim sOldLeft        As Single
    Dim sOldTop         As Single
    Dim objParent       As Object
   
    'adjust the height to take into account the client area
    sItemWHeight = ((sHeight + m_cbo.Height) \ screen.twipsperpixely) + 2
    sItemWidth = m_cbo.Width \ screen.twipsperpixelx

    'hold old locations
    sOldLeft = m_cbo.Left
    sOldTop = m_cbo.Top
    Set objParent = m_cbo.Container
   
    'Resize the combo box
    m_sDropHeight = sItemWHeight
    Call MoveWindow(m_cbo.hwnd, 0, 0, CInt(sItemWidth), CInt(sItemWHeight), 1)
   
    'Move the window back into the container
    m_cbo.Left = sOldLeft
    m_cbo.Top = sOldTop
    Set m_cbo.Container = objParent
end sub
0
 

Author Comment

by:tam031198
ID: 1467367
Anthonyc,  I tested your procedure and the program doesn't recognize the "MoveWindow" function.  Is it an API function ? If so, please tell me which Dll I have to use.  
Also, please tell me how may points this procedure worth,  I'll increase points.

Thanks
0
 

Author Comment

by:tam031198
ID: 1467368
Anthonyc,  I tested your procedure and the program doesn't recognize the "MoveWindow" function.  Is it an API function ? If so, please tell me which Dll I have to use.  
Also, please tell me how may points this procedure worth,  I'll increase points.

Thanks
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1467369
use the VB API VIEWER to find the declare for movewindow

Declare Function MoveWindow Lib "user32" Alias "MoveWindow" (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

0
 

Author Comment

by:tam031198
ID: 1467370
I have it work now.  Thank you very much Anthonyc !
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question