Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: So 26.06.05 09:31 
Warum kann man bei einer ComboBox die Höhe nicht ändern?
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: So 26.06.05 14:13 
user profile iconJRegier hat folgendes geschrieben:
Warum kann man bei einer ComboBox die Höhe nicht ändern?

Das ist eben eine Eigenschaft dieser ComboBox... ;) Bei einem TEdit geht das meines Wissens auch nicht. Und wenn's gehen würde, was würde es bringen? Du hast doch eh nur ein Item, das du anzeigen kannst. Wie willst du mehrere anzeigen? :eyes:
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 26.06.05 14:30 
Die Höhe der Comboxbox kannst du mit der Itemheight-Eigenschaft vergrößern (geht nur, wenn du den style entsprechend setzt ->siehe OH).

@JRegier: wenn es eine Folgefrage zu deiner Fontcombobox ist:
es gibt unterschiedliche Drawstates: unter anderm odcomboboxedit, der dir angibt, das das Eingabefeld selbst gezeichnet wird. reagier darauf, und stell dort wieder einen "normalen" Font ein. so wird der Eintrag nicht in der Schrift selbst gezeichnet und du hast nicht das Problem mit unterschiedlichen Höhen. (Ich geh davon aus, das dich das stört und du bei bestimmten Fonts nur die Hälfte des Namens im Eingabefeld siehst)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.FontboxDrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  with FontBox.Canvas do
  begin
    FillRect(Rect);
    if (odComboBoxEdit in state ) then
      begin
        font.Name:=Form1.Font.Name;
        font.size:=Form1.Font.size;
      end
     else
      begin
        Font.Name := FontBox.Items[Index];
        Font.Size := 0;    // use font's preferred size
      end;
    TextOut(Rect.Left+1, Rect.Top+1, FontBox.Items[Index]);
  end;
end;

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: So 26.06.05 14:32 
Änder doch einfach die Schriftgröße.

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: So 26.06.05 14:38 
user profile iconKeldorn hat folgendes geschrieben:
Die Höhe der Comboxbox kannst du mit der Itemheight-Eigenschaft vergrößern (geht nur, wenn du den style entsprechend setzt ->siehe OH).

Verwirrung am Morgen, den ganzen Tag nur Sorgen... :gruebel: :eyes:

Okay... ;)