if ssCtrl in Shift then begin if (Key in RowMovementKeys) then ClearSelection; case Key of VK_UP, VK_PRIOR: FDataLink.MoveBy(-FDatalink.ActiveRecord); VK_DOWN, VK_NEXT: FDataLink.MoveBy(FDatalink.BufferCount - FDatalink.ActiveRecord - 1); VK_LEFT: MoveCol(FIndicatorOffset, 1); VK_RIGHT: MoveCol(ColCount - 1, -1); VK_HOME: First; VK_END: Last; VK_DELETE: if (not ReadOnly) and not IsEmpty and CanModify and DeletePrompt then if FBooks.Count > 0 then FBooks.Delete else Delete; end end else case Key of VK_UP: PriorRow(True); VK_DOWN: NextRow(True); VK_LEFT: if dgRowSelect in Options then PriorRow(False) else MoveCol(Col - 1, -1); VK_RIGHT: if dgRowSelect in Options then NextRow(False) else MoveCol(Col + 1, 1); VK_HOME: if (ColCount = FIndicatorOffset+1) or (dgRowSelect in Options) then begin ClearSelection; First; end else MoveCol(FIndicatorOffset, 1); VK_END: if (ColCount = FIndicatorOffset+1) or (dgRowSelect in Options) then begin ClearSelection; Last; end else MoveCol(ColCount - 1, -1); VK_NEXT: begin ClearSelection; FDataLink.MoveBy(VisibleRowCount); end; VK_PRIOR: begin ClearSelection; FDataLink.MoveBy(-VisibleRowCount); end; VK_INSERT: if CanModify and (not ReadOnly) and (dgEditing in Options) then begin ClearSelection; Insert; end; VK_TAB: if not (ssAlt in Shift) then Tab(not (ssShift in Shift)); VK_ESCAPE: begin if SysLocale.PriLangID = LANG_KOREAN then FIsESCKey := True; FDatalink.Reset; ClearSelection; if not (dgAlwaysShowEditor in Options) then HideEditor; end; VK_F2: EditorMode := True; end; 自己改改
if (shift=[ssctrl]) and (key=key_x) then ShowMessage('sdfk');
begin
if (Key in RowMovementKeys) then ClearSelection;
case Key of
VK_UP, VK_PRIOR: FDataLink.MoveBy(-FDatalink.ActiveRecord);
VK_DOWN, VK_NEXT: FDataLink.MoveBy(FDatalink.BufferCount - FDatalink.ActiveRecord - 1);
VK_LEFT: MoveCol(FIndicatorOffset, 1);
VK_RIGHT: MoveCol(ColCount - 1, -1);
VK_HOME: First;
VK_END: Last;
VK_DELETE:
if (not ReadOnly) and not IsEmpty
and CanModify and DeletePrompt then
if FBooks.Count > 0 then
FBooks.Delete
else
Delete;
end
end
else
case Key of
VK_UP: PriorRow(True);
VK_DOWN: NextRow(True);
VK_LEFT:
if dgRowSelect in Options then
PriorRow(False) else
MoveCol(Col - 1, -1);
VK_RIGHT:
if dgRowSelect in Options then
NextRow(False) else
MoveCol(Col + 1, 1);
VK_HOME:
if (ColCount = FIndicatorOffset+1)
or (dgRowSelect in Options) then
begin
ClearSelection;
First;
end
else
MoveCol(FIndicatorOffset, 1);
VK_END:
if (ColCount = FIndicatorOffset+1)
or (dgRowSelect in Options) then
begin
ClearSelection;
Last;
end
else
MoveCol(ColCount - 1, -1);
VK_NEXT:
begin
ClearSelection;
FDataLink.MoveBy(VisibleRowCount);
end;
VK_PRIOR:
begin
ClearSelection;
FDataLink.MoveBy(-VisibleRowCount);
end;
VK_INSERT:
if CanModify and (not ReadOnly) and (dgEditing in Options) then
begin
ClearSelection;
Insert;
end;
VK_TAB: if not (ssAlt in Shift) then Tab(not (ssShift in Shift));
VK_ESCAPE:
begin
if SysLocale.PriLangID = LANG_KOREAN then
FIsESCKey := True;
FDatalink.Reset;
ClearSelection;
if not (dgAlwaysShowEditor in Options) then HideEditor;
end;
VK_F2: EditorMode := True;
end;
自己改改
ShowMessage('sdfk');