dabestprogrammerindauniverse
asked on
TAB!
how do u put a tab characted in a memo? i want to align my data so i want to display them in between tabs...how do i do this???
tnx!!!
tnx!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
memo1.lines.add('Before tab'+#9+'after Tab');
This may help:
The program put 9 spaces when user clicks tab button:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if(form1.activecontrol=mem o1)then
begin
if(getkeystate(VK_TAB)<0)t hen
memo1.SelText:=' ';
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
timeout:dword;
begin
systemparametersinfo(spi_g etkeyboard speed,0,@t imeout,0);
timer1.Interval:=timeout;
end;
end.
The program put 9 spaces when user clicks tab button:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Timer1Timer(Sender:
begin
if(form1.activecontrol=mem
begin
if(getkeystate(VK_TAB)<0)t
memo1.SelText:=' ';
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
timeout:dword;
begin
systemparametersinfo(spi_g
timer1.Interval:=timeout;
end;
end.
Why not using RichEdit instead ?
Than you can set your own tabs like this :
With RichEdit1.Paragraph do
begin
Tab[0] := 90;
Tab[1] := 150;
Tab[2] := 200;
Tab[3] := 250;
end;
Be sure that WantTabs-property is set to True.
Than you can set your own tabs like this :
With RichEdit1.Paragraph do
begin
Tab[0] := 90;
Tab[1] := 150;
Tab[2] := 200;
Tab[3] := 250;
end;
Be sure that WantTabs-property is set to True.