Do anybody know the way to expand ComboBox?
I need to set focus and expand this control automatically...
How can I expand ComboBox via application
Moderator: Rathinagiri
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: How can I expand ComboBox via application
Hi Marek,
What do you mean with expand? Add Items or enlarge combobox?
Serge
What do you mean with expand? Add Items or enlarge combobox?
Serge
There's nothing you can do that can't be done...
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: How can I expand ComboBox via application
I think the program should open a combox when it comes to this field,
Probably ON GOTFOCUS , but I do not know how to get control to open the list,
Control requires a click or cursor action
Probably ON GOTFOCUS , but I do not know how to get control to open the list,
Control requires a click or cursor action
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: How can I expand ComboBox via application
Yes. It can be done!
Consider this...
Consider this...
Code: Select all
define combobox usernames
row 10
col 160
width 330
sort .t.
fontsize nFontSize
fontname cFontName
fontbold lFontBold
ongotfocus comboboxdropdown()
items aUsers
end combobox
//
//
//
function comboboxdropdown
local nHandle := GetControlHandle (this.name,thiswindow.name)
ComboBoxShowDropDown(nHandle)
return nil
function comboboxdropdownclose( cWindowName, cControlName )
local nHandle
default cWindowName := this.name
default cControlName := thiswindow.name
nHandle := GetControlHandle ( cControlName , cWindowName )
ComboBoxShowDropDownClose( nHandle )
return nil
function ensuretopindex
local nHandle := GetControlHandle (this.name,thiswindow.name)
if this.value > 0
ComboBoxSetTopIndex(nHandle,this.value)
endif
return nil
#pragma BEGINDUMP
#include <windows.h>
#include <commctrl.h>
#include "hbapi.h"
#include <wingdi.h>
HB_FUNC ( COMBOBOXSHOWDROPDOWN )
{
HWND hWnd1;
hWnd1 = (HWND) hb_parnl (1);
SendMessage((HWND) hWnd1,CB_SHOWDROPDOWN, (WPARAM)(int) 1,(LPARAM)(int) 0);
}
HB_FUNC ( COMBOBOXSHOWDROPDOWNCLOSE )
{
HWND hWnd1;
hWnd1 = (HWND) hb_parnl (1);
SendMessage((HWND) hWnd1,CB_SHOWDROPDOWN, (WPARAM)(int) 0,(LPARAM)(int) 0);
}
HB_FUNC ( COMBOBOXSETTOPINDEX )
{
HWND hWnd1;
hWnd1 = (HWND) hb_parnl (1);
hb_retni(SendMessage((HWND) hWnd1,CB_SETTOPINDEX, (WPARAM)(int) hb_parni(2) - 1,(LPARAM) 0 ));
}
#pragma ENDDUMP
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: How can I expand ComboBox via application
Thank you! It works perfectly as I mentioned