Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi DT_TABSTOP in Drawtext setzen (https://www.delphipraxis.net/146486-dt_tabstop-drawtext-setzen.html)

runningsoft 20. Jan 2010 23:02


DT_TABSTOP in Drawtext setzen
 
Hallo,

wenn ich die Hilfe zur API-Funktion DrawText richtig verstanden habe, kann ich mittels des Flags DT_TABSTOP die Breite der Tabulatoren, die beim ausdrucken gesetzt werden, beeinflussen.

Wie lautet denn nun aber die Syntax, um die Schrittweite des Tabulators auf z.B. 12 einzustellen (Standard sind ja wohl 8 Zeichen).

So etwas wie

Delphi-Quellcode:
const DT_TABSTOP = 12;
funktioniert leider nicht.

Vielen Dank

Steffen

sx2008 20. Jan 2010 23:58

Re: DT_TABSTOP in Drawtext setzen
 
Zitat:

DT_TABSTOP
Sets tab stops. Bits 8–15, which form the high-order byte of the low-order word, of the uFormat parameter specify the number of characters for each tab. The default number of characters per tab is eight. You cannot use the DT_CALCRECT, DT_EXTERNALLEADING, DT_INTERNAL, DT_NOCLIP, and DT_NOPREFIX values with the DT_TABSTOP value.
Delphi-Quellcode:
var
  uFormat : DWORD;
  Tabweite : integer;
begin
  Tabweite := 3;
  uFormat := DT_TABSTOP or DT_LEFT; // linksbündig mit Tabs
  uFormat := uFormat or (Tabweite shl 8);
  DrawText(..., uFormat);

runningsoft 21. Jan 2010 08:04

Re: DT_TABSTOP in Drawtext setzen
 
Funktioniert perfekt, Danke für die Hilfe.

Steffen


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:38 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