AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

TButton align to left

Ein Thema von mr_fahrrad · begonnen am 17. Jan 2007 · letzter Beitrag vom 17. Jan 2007
Antwort Antwort
mr_fahrrad

Registriert seit: 28. Dez 2006
46 Beiträge
 
#1

TButton align to left

  Alt 17. Jan 2007, 15:57
How i make to align to left a text in the Button component?

Idont find solution for this, anybody can helpme?
  Mit Zitat antworten Zitat
MrKnogge

Registriert seit: 9. Jun 2003
Ort: Pforzheim
2.458 Beiträge
 
Delphi 2007 Professional
 
#2

Re: TButton align to left

  Alt 17. Jan 2007, 16:08
Moin mr_fahrrad,

du musst dir eine eigene Komponente vom Typ TButton ableiten und die Eigenschaft Align selbst hinzufügen.
Welche Delphi-Version hast du ?

Gruß
Christian Bootz
Einstein ist tot, Newton ist tot,
und mir ist auch schon ganz schlecht...
  Mit Zitat antworten Zitat
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#3

Re: TButton align to left

  Alt 17. Jan 2007, 16:12
Maybe TSpeedButton or TBitButton have a text-align property...

If you have to draw the text yourself (e.g. following MrKnogge's suggestion), you might want to draw the text yourself: MSDN-Library durchsuchenDrawText.

On the other Hand, you should be able to tell the WinAPI to align the text... but I don't know how.
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#4

Re: TButton align to left

  Alt 17. Jan 2007, 16:39
Hi Lukas,

Zitat von DGL-luke:
... On the other Hand, you should be able to tell the WinAPI to align the text... but I don't know how.
it is a matter of style:

Delphi-Quellcode:
procedure TDemoForm.ButtonClick(Sender: TObject);
var
  dwStyle: LongWord;
begin
  with Sender as TButton do
  begin
    dwStyle := GetWindowLong(Handle, GWL_STYLE);
    dwStyle := dwStyle and not BS_CENTER or BS_LEFT;
    SetWindowLong(Handle, GWL_STYLE, dwStyle);
    Invalidate;
  end;
end;
Regards
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:48 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz