解决方案 » 有了dbgrid1.options.dgmultiselect:=true;必须按下Ctrl键,才能实现多选, 修改源代码,把以下内容if Select and (ssShift in Shift) then改为if Select then 记住是在DBGRIDS单元里: if ssCtrl in Shift then //这句改为if true then还有把以下这段去掉: if ssCtrl in Shift then Curr…
在delphi中,很多窗体和控件的鼠标事件里面已经将鼠标按键状态封装好传给响应事件的函数,所以这种情况直接使用就可以,但在某些时候,我们没有这些事件可以处理时,想判断鼠标按键是否按下的状态,就需要借助API或者消息了,使用API和消息可分别应对2种不同情形: 1)使用API: GetAsyncKeyState,适合实时检测,下面代码演示判断鼠标是否按下左键 function IsMouseLButtonDown():Boolean;begin Result := (Windows.GetAs…
1. 首先继承一个listbox,来获得按住ctrl键时,点击的item public class ListBoxEx : ListBox { public BeatTemplateWave GetAnitem() { var obj = this.AnchorItem; if (obj != null) { Type type = obj.GetType(); System.Reflection.PropertyInfo propertyInfo = type.GetProperty("Ite…