Solved

ComboBox pulldown list

Posted on 1998-07-31
5
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 30 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month9 days, 14 hours left to enroll

624 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