Home > Back-end >  Excuse me, how to enter the dbgrid a column after the cursor directly display flashing status??
Excuse me, how to enter the dbgrid a column after the cursor directly display flashing status??

Time:10-17

Excuse me, how to enter the dbgrid a column after the cursor directly display flashing state, other all don't, that is to choose which cell, where is the mouse and cursor directly in the flashing, excuse me, how to set up,

CodePudding user response:

Set dgAlwaysShowEditor to True, the mouse to click enter to edit status:
DBGrid1. Options:=DBGrid1. Options + [dgAlwaysShowEditor];

CodePudding user response:

Feiba7288 method or not, after the point into the cell, the cell's text or in the selected state, not the mouse point, which the kind of stop directly

CodePudding user response:

Dbgrid can only be such, want to finer Settings, or a third party of the grid, such as cxDbGrid,

Or use an analog this way
The first is to set up the
Dbgrid1. Options:=dbgrid1. Options + [dgAlwaysShowEditor];
Then using buttons in dbgrid1 OnCellClick event simulation:
 
Procedure TForm1. Dbgrid1CellClick (Column: TColumn);
The begin
Keybd_event (VK_RETURN, MapVirtualKey (VK_RETURN, 0), 0, 0).
Keybd_event (VK_RETURN, MapVirtualKey (VK_RETURN, 0), KEYEVENTF_KEYUP, 0).
Keybd_event (VK_RIGHT, MapVirtualKey (VK_RIGHT, 0), 0, 0).
Keybd_event (VK_RIGHT, MapVirtualKey (VK_RIGHT, 0), KEYEVENTF_KEYUP, 0).
end;

CodePudding user response:

refer to the second floor lantianhf25 response:
feiba7288 method or not, after the point into the cell, the cell's text or in the selected state, not the mouse point, stop directly which the


The following code can, but must be put in onm ouseUp events will response inside!!!!!!

 
Procedure TfmMain. DBGrid1MouseUp (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
Var
HEdit: THandle;
The begin
HEdit:=FindWindowEx (DBGrid1. Handle, 0, 'TDBGridInplaceEdit, nil);
If hEdit & lt;> 0 then
The begin
//SendMessage (hEdit EM_SETSEL, 0, 0);//move the cursor to the front of the most
SendMessage (hEdit EM_SETSEL, $7 FFFFFFF, Longint ($FFFFFFFF));//move the cursor to the end of the
end;
end;

CodePudding user response:

reference 1st floor feiba7288 response:
Settings dgAlwaysShowEditor to True, the mouse to click enter to edit status:
DBGrid1. Options:=DBGrid1. Options + [dgAlwaysShowEditor];


this is still so set!!!!!!!!!!
  • Related