Forumunuz.Com

Forumunuz.Com (https://www.forumunuz.com/)
-   Webmaster Forum (https://www.forumunuz.com/webmaster-forum/)
-   -   DBGridde Excel gibi CTRL+D işlevini kullanmak (https://www.forumunuz.com/webmaster-forum/17345-dbgridde-excel-gibi-ctrld-islevini-kullanmak.html)

Kaf Dağı 27 Mart 2015 14:55

DBGridde Excel gibi CTRL+D işlevini kullanmak
 
Kod:

procedure THGirisF.DBGrid1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
 
var
  v : variant;
 col : string;
begin
 
  if (GetKeyState(ord('D')) AND 128) = 128 then
    if (GetKeyState(VK_CONTROL) AND 128) = 128 then
    begin
      DM.KARGOMEM.DisableControls;
 
      col := DBGrid1.SelectedField.FieldName;
 
      With DM.KARGOMEM do
      begin
 
      if RecNo = -1 then //for a new reocrd just appended
      begin
        Last;
        v := FieldValues[col];
        Append;
        DBGrid1.Fields[DBGrid1.SelectedField.FieldNo-1].Value := v;
 
 
      end
      else
      begin  // for existing record
        Prior;
        v := FieldValues[col];
        next;
        Edit;
        FieldValues[col] := v;
        Post;
      end;
 
      end;
      //ShowMessage('correct column: '+col+' with value: '+v);
      DM.KARGOMEM.EnableControls;
    end;



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 05:08.

Powered by vBulletin® Version 3.8.9   Copyright ©2000 - 2026, vBulletin Solutions, Inc.

Site kurucuları: Damla ve Meltem