Re: [WIN] how make empty combo not "open" (dropdown) if clicked on?

new topic     » goto parent     » topic index » view thread      » older message » newer message

I think I would try sending a message  useing CB_GETCOUNT and because
the index is zero-based if the return value is  > 0 then it must contain items 
when I had this established I could proceed.to CB_SHOWDROPDOWN true 

what about you? I havent tried this but its sounds resonable.

Something like this:

procedure Combo3_onEvent (atom event, atom wParam, atom lParam)
  if event = CBN_DROPDOWN then
    if sendMessage(Combo3,CB_GETCOUNT, 0,0) > 0 then
       dummy = sendMessage(Combo3,CB_SHOWDROPDOWN , True,0)
    end if
  end if
end procedure
onEvent[Combo3] = routine_id("Combo3_onEvent")

Euman
euman at bellsouth.net


> 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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu