二楼进行:cxgrid 修改。 如果是版本比较高的CXGRID 就很方便。 直接设置:cxLookupComboBox1.Properties.IncrementalSearch:=False ; 需要注意的是,在CXGRID中并没有把这个属性发布出来。需要用代码编写。或者是手动修改控件。 如果CXGRID的版本是比较早的版本。 需要修改 单元:unit cxTextEdit;procedure TcxCustomTextEdit.DoEditKeyPress(var Key: Char); function FillFromList(var AFindText: string): Boolean; var ATail: string; L: Integer; S: string; begin S := AFindText; if InnerTextEdit.ImeLastChar <> #0 then S := S + InnerTextEdit.ImeLastChar; // 是这里的问题。WENGJIANFEI 修改;也可以直接设置不要这个功能; if Properties.IncrementalSearch=true then Result := ILookupData.Locate(S, ATail, False) //问题是这一句,只要注释即可,没看出来为什么 else Result:=False; ............
控件如果用鼠标滚动也会发现 变化,通过下面的方式可以处理function TcxCustomTextEdit.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; {$IFNDEF VCL}const{$ENDIF} MousePos: TPoint): Boolean; const AGoDirectionMap: array [Boolean] of TcxEditLookupDataGoDirection = (egdNext, egdPrev); var APrevCurrentKey: TcxEditValue; begin //WENGJIANFEI 增加修改 IF Properties.IncrementalSearch = TRUE then Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos) //这句直接注释掉即可.把Result:=True ELSE Result:=True; if Result then Exit; //WENGJIANFEI 修改 //原来 Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos) Result := GetScrollLookupDataList(escMouseWheel) and not HasPopupWindow and Properties.UseLookupData and not ILookupData.IsEmpty and HandleMouseWheel(Shift); if not(Result and DoEditing) then Exit;
直接设置:cxLookupComboBox1.Properties.IncrementalSearch:=False ;
需要注意的是,在CXGRID中并没有把这个属性发布出来。需要用代码编写。或者是手动修改控件。
如果CXGRID的版本是比较早的版本。
需要修改 单元:unit cxTextEdit;procedure TcxCustomTextEdit.DoEditKeyPress(var Key: Char); function FillFromList(var AFindText: string): Boolean;
var
ATail: string;
L: Integer;
S: string;
begin
S := AFindText;
if InnerTextEdit.ImeLastChar <> #0 then
S := S + InnerTextEdit.ImeLastChar;
// 是这里的问题。WENGJIANFEI 修改;也可以直接设置不要这个功能;
if Properties.IncrementalSearch=true then
Result := ILookupData.Locate(S, ATail, False) //问题是这一句,只要注释即可,没看出来为什么
else
Result:=False;
............
{$IFNDEF VCL}const{$ENDIF} MousePos: TPoint): Boolean;
const
AGoDirectionMap: array [Boolean] of TcxEditLookupDataGoDirection = (egdNext, egdPrev);
var
APrevCurrentKey: TcxEditValue;
begin
//WENGJIANFEI 增加修改
IF Properties.IncrementalSearch = TRUE then
Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos) //这句直接注释掉即可.把Result:=True
ELSE
Result:=True;
if Result then
Exit;
//WENGJIANFEI 修改
//原来 Result := inherited DoMouseWheel(Shift, WheelDelta, MousePos)
Result := GetScrollLookupDataList(escMouseWheel) and not HasPopupWindow and
Properties.UseLookupData and not ILookupData.IsEmpty and HandleMouseWheel(Shift);
if not(Result and DoEditing) then
Exit;
girdeh用起来确实方便