Q&A

  • 스트링그리드에서 텝말고 엔터로 이동할려면
스트링그리드에서 텝말고 엔터로 이동하려고 합니다.

어느분이 올린것처럼 해봤지만 않되네요.



3  COMMENTS
  • Profile
    조규춘 2000.09.28 00:51
    호야 wrote:

    > 스트링그리드에서 텝말고 엔터로 이동하려고 합니다.

    > 어느분이 올린것처럼 해봤지만 않되네요.

    >



    하이염...



    unit Unit1;



    interface



    uses

    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

    Grids;



    type

    TForm1 = class(TForm)

    StringGrid1: TStringGrid;

    procedure StringGrid1KeyPress(Sender: TObject; var Key: Char);

    private

    { Private declarations }

    public

    { Public declarations }

    end;



    var

    Form1: TForm1;



    implementation



    {$R *.DFM}



    procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);

    begin

    if Key = #13 then begin

    Key := #0;

    with StringGrid1 do begin

    { //좌우로움직이는경우

    if Col < ColCount-1 then //다음 column

    Col := Col + 1

    else if Row < RowCount-1 then //다음 Row

    begin

    Row := Row + 1;

    Col := 1;

    end

    else

    begin //Grid의 끝이면 Top으로

    Row := 1;

    Col := 1;

    end;

    }



    //아래위로 움직이는겨우

    if Row < RowCount-1 then

    Row := Row + 1

    else if Col < ColCount-1 then

    begin

    Col := Col + 1;

    Row := 1;

    end

    else

    begin

    Row := 1;

    Col := 1;

    end;



    end; //with StringGrid1 do begin...End...

    end; //if Key = #13 then begin...End..



    end;



    end.



    바이염.

  • Profile
    호야 2000.09.28 01:32
    조규춘 wrote:

    > 호야 wrote:

    > > 스트링그리드에서 텝말고 엔터로 이동하려고 합니다.

    > > 어느분이 올린것처럼 해봤지만 않되네요.

    > >

    >

    > 하이염...

    >

    > unit Unit1;

    >

    > interface

    >

    > uses

    > Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

    > Grids;

    >

    > type

    > TForm1 = class(TForm)

    > StringGrid1: TStringGrid;

    > procedure StringGrid1KeyPress(Sender: TObject; var Key: Char);

    > private

    > { Private declarations }

    > public

    > { Public declarations }

    > end;

    >

    > var

    > Form1: TForm1;

    >

    > implementation

    >

    > {$R *.DFM}

    >

    > procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);

    > begin

    > if Key = #13 then begin

    > Key := #0;

    > with StringGrid1 do begin

    > { //좌우로움직이는경우

    > if Col < ColCount-1 then //다음 column

    > Col := Col + 1

    > else if Row < RowCount-1 then //다음 Row

    > begin

    > Row := Row + 1;

    > Col := 1;

    > end

    > else

    > begin //Grid의 끝이면 Top으로

    > Row := 1;

    > Col := 1;

    > end;

    > }

    >

    > //아래위로 움직이는겨우

    > if Row < RowCount-1 then

    > Row := Row + 1

    > else if Col < ColCount-1 then

    > begin

    > Col := Col + 1;

    > Row := 1;

    > end

    > else

    > begin

    > Row := 1;

    > Col := 1;

    > end;

    >

    > end; //with StringGrid1 do begin...End...

    > end; //if Key = #13 then begin...End..

    >

    > end;

    >

    > end.

    >

    > 바이염.

  • Profile
    호야 2000.09.28 01:29
    조규춘 wrote:

    > 호야 wrote:

    > > 스트링그리드에서 텝말고 엔터로 이동하려고 합니다.

    > > 어느분이 올린것처럼 해봤지만 않되네요.

    > >

    >

    > 하이염...

    >

    > unit Unit1;

    >

    > interface

    >

    > uses

    > Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

    > Grids;

    >

    > type

    > TForm1 = class(TForm)

    > StringGrid1: TStringGrid;

    > procedure StringGrid1KeyPress(Sender: TObject; var Key: Char);

    > private

    > { Private declarations }

    > public

    > { Public declarations }

    > end;

    >

    > var

    > Form1: TForm1;

    >

    > implementation

    >

    > {$R *.DFM}

    >

    > procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);

    > begin

    > if Key = #13 then begin

    > Key := #0;

    > with StringGrid1 do begin

    > { //좌우로움직이는경우

    > if Col < ColCount-1 then //다음 column

    > Col := Col + 1

    > else if Row < RowCount-1 then //다음 Row

    > begin

    > Row := Row + 1;

    > Col := 1;

    > end

    > else

    > begin //Grid의 끝이면 Top으로

    > Row := 1;

    > Col := 1;

    > end;

    > }

    >

    > //아래위로 움직이는겨우

    > if Row < RowCount-1 then

    > Row := Row + 1

    > else if Col < ColCount-1 then

    > begin

    > Col := Col + 1;

    > Row := 1;

    > end

    > else

    > begin

    > Row := 1;

    > Col := 1;

    > end;

    >

    > end; //with StringGrid1 do begin...End...

    > end; //if Key = #13 then begin...End..

    >

    > end;

    >

    > end.

    >

    > 바이염.