DOCUMENT:Q136310 24-AUG-1999 [foxpro] TITLE :How to Expand a Combo Box Programmatically PRODUCT :Microsoft FoxPro PROD/VER:3.00 OPER/SYS: KEYWORDS:kbcode ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, version 3.0 ------------------------------------------------------------------------------- SUMMARY ======= This article demonstrates how to expand a combo box programmatically. This may be useful when a user presses the TAB key to move into the combo box or when a command button Click event procedure gives the focus to the combo box. It is assumed that you have a combo box on a form and are looking for ways to activate it programmatically. MORE INFORMATION ================ Following are two methods for expanding a combo box programmatically: Method One: Using Pixel Coordinates ----------------------------------- Place the following code in the GotFocus method of the combo box: tCol=THISFORM.Combo1.Left + THISFORM.Combo1.Width - 4 tRow=THISFORM.Combo1.Top + 2 MOUSE CLICK AT tRow, tCol PIXELS WINDOW (THISFORM.Name) The combo box expands every time it receives the focus. Method Two: Using Keyboard Buffer --------------------------------- Place the following code in the GotFocus method of the combo box: KEYBOARD '{ALT+DnArrow}' The combo box expands every time it receives the focus. Additional query words: VFoxWin drop down dropdown list ====================================================================== Keywords : kbcode Technology : kbVFPsearch kbAudDeveloper kbVFP300 Version : 3.00 ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1999.