[SOLVED] Opening a Combo/DropDown when GetFocus | Uniface 9 | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

—  Results per page  —








— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters
For a group of consecutive words like 'end of support' use Match phrase

sp_Feed Topic RSS sp_TopicIcon
[SOLVED] Opening a Combo/DropDown when GetFocus
15 Nov 2017
10:20 pm
Avatar
gianni
Member
Forum Posts: 297
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Unifacers,

I am trying to reuse the same technique already described from D.Iseli (thanks Daniel, it works!) in this sample:

https://unifaceinfo.com/forum/uniface9/howcanipositionthecursorwithinaneditbox/

to automatically open a comboBox or a dropDownList when end user is getting focus on it.
The message to be passed to the widget should be:

CB_SHOWDROPDOWN = 335 ; 0x014F

and the related ASYNC instruction is:

activate “USER32”.SendMessage(lngHWnd, <CB_SHOWDROPDOWN>, 1, 0)

It seems everything is executed but the result is not as expected…nothing happen! 🙁

Can anyone help me to understand why it should not work with ComboBox or DropDownList as of 9.7.04 ?

Thanks!
Gianni

17 Nov 2017
4:33 pm
Avatar
diseli
Admin
Forum Posts: 935
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Gianni,

I’ve created a small sample that is using the USER32 function keybd_event (see the Community Sample Automatically open Drop-Down List). The mentioned function can synthesize a keystroke (in the sample form it’s the DOWN ARROW key).

Hope this helps.

Daniel

18 Nov 2017
4:02 pm
Avatar
gianni
Member
Forum Posts: 297
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Thanks Daniel, your solution is working either with DropDown and Combo!

In the mean time I’ve made some further analysis on possible reasons my solution did not work.

It should work when:

An application sends a CB_SHOWDROPDOWN message to show or hide the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.

but:

The message has no effect on a combo box created with the CBS_SIMPLE style.

My conclusion is: Uniface is using the simple style.

Thanks again for your help. This thread could be marked as SOLVED.

Gianni

20 Nov 2017
10:26 am
Avatar
diseli
Admin
Forum Posts: 935
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Thanks Gianni.

The combo box is actually using the CBS_DROPDOWN style. When I send the message CB_SHOWDROPDOWN to the drop-down list or combo box then I can see that the list part is opened, but then it’s immediately closed again. I (so far) could not find a way to prevent this from happening. Using keybd_event seems to be a better choice here.

Daniel

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 131

Currently Online: Adrian Gosbell, Lauterbach, tommyb42
19 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ulrich-merkel: 1762

Iain Sharp: 648

Theo Neeskens: 353

gianni: 297

rogerw: 251

istiller: 235

Knut: 201

lalitpct: 197

Arjen van Vliet: 175

sochaz: 173

Member Stats:

Guest Posters: 3

Members: 8444

Moderators: 0

Admins: 8

Forum Stats:

Groups: 1

Forums: 62

Topics: 2161

Posts: 9344

Newest Members:

briancoleman@aurion.com, kevinmckeever@aurion.com, WarrenNob, brigittebr18, agrohimcsh, englewtat, AbbalibaJor, HanhitCholo, RobertEdumb, lenorajr69

Administrators: admin: 23, Adrian Gosbell: 303, diseli: 935, Bob Maier: 3, Nico Peereboom: 75, Michael Rabone: 4, richiet: 406, JanCees: 28