Re: [WIN] how make empty combo not "open" (dropdown) if clicked on?
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 20, 2001
- 409 views
I can think of three quick ways to do this. 1) Make it disabled if it contains nothing. 2) Set the height to zero if it contains nothing. 3) Make windows ignore the dropdown message if event = CBN_DROPDOWN then if getCount(Combo3) = 0 then -- if nothing in combo, ignore it returnValue(0) end if end if ----- Original Message ----- From: "Dan Moyer" <DANIELMOYER at prodigy.net> To: "EUforum" <EUforum at topica.com> Sent: Sunday, October 21, 2001 1:48 PM Subject: [WIN] how make empty combo not "open" (dropdown) if clicked on? > > I have a combo box (defined as a DropDownList), which sometimes has stuff in > it & sometimes doesn't, and I want it *not* to drop down if it's clicked on > and there's nothing in it. Nothing I've tried works. Here's the last thing > I tried, can anyone suggest something that would work? (I tried commenting > out my "getCount" test, in case something was happening I didn't know about, > and the list still drops down when clicked on.) > > > procedure Combo3_onEvent (atom event, atom wParam, atom lParam) > > if event = CBN_DROPDOWN then > if getCount(Combo3) = 0 then -- if nothing in combo, close it > dummy = sendMessage(Combo3,CB_SHOWDROPDOWN , False,0) > end if > end if > end procedure > onEvent[Combo3] = routine_id("Combo3_onEvent") > > Dan Moyer > > >