Re: Grids ?




On Nov 18, 9:23 am, "FrancoJommi" <franco.jo...@xxxxxx> wrote:
Yes,thanks I am trying, but while I found how to change colors, I cannot
find how to align my strings (which in fact are numbers). Is there some API
call or something else ?

Typically (with some alternatives) ...

with StringGrid1 do begin
if (ACol = 0) then begin
// if (ACol in [2,4,6..8]) then begin
// if (ARow = 0 then begin) // header row
Canvas.Font.Name := 'Arial';
Canvas.Font.Size := 12;
Canvas.FillRect(ARect);
DrawText(Canvas.Handle, PChar(Cells[ACol, ARow]), -1, ARect,
DT_CENTER or DT_VCENTER or DT_SINGLELINE);
// DrawText(Canvas.Handle, PChar(Cells[ACol, ARow]), -1, ARect,
// DT_RIGHT or DT_VCENTER or DT_SINGLELINE);
// DrawText(Canvas.Handle, PChar(Cells[ACol, ARow]), -1, ARect,
// DT_LEFTT or DT_VCENTER or DT_SINGLELINE);
end;

DrawText() is a WinAPI call - look in Delphi Win32 help or on MSDN
(Microsoft Developers Network) web-site, or get a library edition of
MSDN (best £120 I ever spent).

Alan Lloyd

.



Relevant Pages

  • Re: Grids ?
    ... find how to align my strings. ... API ... Heiner ...
    (comp.lang.pascal.delphi.misc)
  • Re: Case expressionlist-n
    ... What version of MSDN is that from? ... "Select Case statement" took me to that VB Scripting version. ... Case matches strings that are exactly ... The first time I switched it from the ...
    (microsoft.public.vb.general.discussion)
  • PInvoke Issues...
    ... I think I'm having PInvoke issues because I imported the service API ... strings and the DWORD correctly - yes? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: DLL Marshalling : How do I treat a char FAR * HUGE * FAR * in C# ?
    ... The P/Invoke layer doesn't know how to marsal arrays back to the managed ... are you supplying the memory where the strings are written to? ... > API call by doing a type conversion for each parameter. ... > public static extern int XcDatabaseCodes( ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Equivalent to GetKeyNameText for WM_APPCOMMAND messages?
    ... >> Is there an equivalent of the GetKeyNameText API for the WM_APPCOMMAND ... I need to create user-readable strings to use in my keyboard ... WM_APPCOMMAND has nothing directly to do with keyboard input. ...
    (microsoft.public.win32.programmer.ui)