主要想完成像资源管理器那些不按Ctrl拖动时能实现移动操作,而按Ctrl拖动时能实现复制操作。不知有没有办法呢?

解决方案 »

  1.   

    可以设置DragMode 为 手动 。然后在要拖动的控件的OnMouseDown事件中调用控件的BeginDrag(False),其他都一样。OnMouseDown有一个参数可以知道按吓了Ctrl,Alt,Shift的信息。
      

  2.   

    if ssCtrl in shift then
      add your code here// ssAlt ssShift
      

  3.   

    if (GetKeyState(VK_CONTROL) and $80) > 0 then
      ShowMessage('Ctrl键按下');
      

  4.   

    用这个函数吧!function TMainForm.GetCtrlState: Boolean;
    begin {Get the VK_Ctrl state, True is pressed, False is not}
    if GetKeyState(VK_CONTROL) < 0 then Result := True //Press Ctrl
      else Result := False; //Not press Ctrl
    end;