Autor Beitrag
BlackPhantom
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 144

Win 2000, Win XP, UNIX
D7 Prof, C, HTML, VB 5
BeitragVerfasst: So 02.03.03 20:27 
n'abend

Ich hätte da eine Frage:

Ich habe einen Button auf der Form und habe ihn vertikal langgezogen (wenn ihr versteht).
Die SChrift ist jedoch waagerecht. Wie bekomme ich die SChrift auch vertikal auf dem Button zB

B
u
t
t
o
n
1


Kann mir da jemand helfen? Oder geht es gar nicht?
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: So 02.03.03 20:34 
Kurze und knappe Antwort: Das geht nicht mit den Windows Standart Buttons.
Popov
Gast
Erhaltene Danke: 1



BeitragVerfasst: So 02.03.03 21:43 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm1.Button1Click(Sender: TObject); 
var
  H : Integer;
begin
  if not (Sender is TButton) then Exit;

  with TButton(Sender) do begin
    H := GetWindowLong(Handle, GWL_STYLE);
    SetWindowLong(Handle, GWL_STYLE, H or BS_MULTILINE);
    Caption :=
      'B' + #13#10 +
      'u' + #13#10 +
      't' + #13#10 +
      't' + #13#10 +
      'o' + #13#10 +
      'n';

    Width := 25;
    Height := 114;
  end;
end;
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: So 02.03.03 21:54 
der möchte doch die schrift vertikal haben, nicht horizontal

so das das B dan auf der seite liegt, und das geht net
BlackPhantom Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 144

Win 2000, Win XP, UNIX
D7 Prof, C, HTML, VB 5
BeitragVerfasst: So 02.03.03 22:46 
ne ne Popov hat es schon richtig verstanden. Danke Popov :D
Cash
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Mo 03.03.03 16:23 
Ich hab das mit dem Button auchgemacht....aber worunter muss ich es denn schreiben, wenn ich möchte, dass der Button beim Starten des Projects sofort eine senkrechte Caption hat? Unter Formcreate,FormActivate...ich weiß es nicht.

Und wenn ich dann die richtige Procedur gefunden habe, was muss ich eingeben unter (sender) den Namen des Buttons oder was?

thx4all
Cash
Popov
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mo 03.03.03 16:48 
Du kannst es auch unter Create machen.

Ich hab hier was allgemeines:

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
  private
    { Private-Deklarationen }
    procedure VButton(Sender: TObject; W2, H2: Integer);
    ...

procedure TForm1.VButton(Sender: TObject; W2, H2: Integer);
var
  h, i: Integer;
  s: String;
begin
  if not (Sender is TButton) then Exit;

  with TButton(Sender) do begin
    h := GetWindowLong(Handle, GWL_STYLE);
    SetWindowLong(Handle, GWL_STYLE, h or BS_MULTILINE);

    s := Caption;
    Caption := '';
    for i := 1 to Length(s) do begin
      Caption := Caption + s[i];
      if i < Length(s) then Caption := Caption + #13#10;
    end;

    Width := W2;
    Height := H2;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  VButton(Sender, 25, 114);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  VButton(Button1, 25, 114);
end;


Sender ist einfach der Sender selbst oder die Buttonkomponente die du übergibst.