Lazarus

Programming => LCL => Topic started by: Avishai on July 10, 2012, 11:33:25 am

Title: [Solved] TComboBox DropDown Width?
Post by: Avishai on July 10, 2012, 11:33:25 am
Is there a way to make the DropDown of a TComblox wider than TComboBox?  I see it in other apps but I have not found a way with Lazarus TCombox.
Title: Re: TComboBox DropDown Width?
Post by: wp on July 10, 2012, 12:35:58 pm
This (http://delphi.about.com/b/2012/07/03/sizing-tcombobox-drop-down-list-width-no-cut-off.htm) is for Delphi and Windows. Maybe it works for Lazarus as well.
Title: Re: TComboBox DropDown Width?
Post by: Avishai on July 10, 2012, 01:03:15 pm
Thanks wp.  It took a bit to find all the units to add to the Uses, but it worked perfectly.  I think it is Windows Only, but that is OK for me.

I wrote a TFontComboBox but some Font Names are very long.  I didn't want to make the ComboBox so wide and it looked bad.  Now it is fine.

If anyone wants the TFontComboBox, let me know and I will share.
Title: Re: TComboBox DropDown Width?
Post by: Martin_fr on July 10, 2012, 01:10:08 pm
Thanks wp.  It took a bit to find all the units to add to the Uses, but it worked perfectly.  I think it is Windows Only, but that is OK for me.

If you use 0.9.31 and install package cody: There is an "identifier/unit dictionary". It finds the unit for any identifier.
Title: Re: [Solved] TComboBox DropDown Width?
Post by: Avishai on July 10, 2012, 01:12:07 pm
Thanks Martin_fr,  I will have to see if I can find it.  It sounds like a real time saver :)
Title: Re: [Solved] TComboBox DropDown Width?
Post by: Ocye on July 13, 2012, 09:45:13 pm
Any idea how to increase size under *nix? Unfortunately, CB_SETDROPPEDWIDTH does not exists but native Gtk2 procedures, I guess it's themed stuff, work well.
Title: Re: [Solved] TComboBox DropDown Width?
Post by: CM630 on October 24, 2018, 11:10:08 am

Since it took me quite a long time to find the solution, here is what works for me (Sadly, only in Windows):

Code: Pascal  [Select][+][-]
  1. ...uses... Windows...
  2.  
  3.  
  4. procedure ComboDDWidth( ComboBox : TComboBox; DDWidth: longint);
  5. begin
  6.   sendMessage(ComboBox.Handle, CB_SETDROPPEDWIDTH, DDWidth, 0);
  7. end;  
TinyPortal © 2005-2018