Ver Mensaje Individual
  #4  
Antiguo 15-02-2017
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Tal como indica aguml, puedes usar un combobox "ownerdraw", o sea con su propiedad Style en csOwnerDrawFixed. Con eso, ajustando la propiedad ItemHeight obtienes la altura deseada para el combo. Sin embargo, el texto de cada item queda pegado al borde superior y se ve un poco feo. Para centrarlo tienes que implementar el evento OnDrawItem:

Código Delphi [-]
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
  with (Control as TCustomComboBox) do
  begin
    Canvas.FillRect(Rect);
    InflateRect(Rect, -2, 0);
    Windows.DrawText(Canvas.Handle, PChar(Items[Index]), -1, Rect, DT_SINGLELINE or DT_VCENTER);
  end;
end;

LineComment Saludos
Responder Con Cita