dev 按指定按键弹出下拉控件

 if (AItem = cxGrid1DBTableView1cgsl) and (key in [106, 107, 109, 111]) then
 begin
  if AEdit <> nil then
    if AEdit.ClassType = TcxCalcEdit then //如果是计算器
      if not TcxCalcEdit(AEdit).DroppedDown then       //没有弹起状态
      begin
       TcxCalcEditProperties(cxGrid1DBTableView1cgsl.Properties).ImmediateDropDownWhenKeyPressed := True;
       cxGrid1DBTableView1.Controller.EditingController.ShowEdit(AItem, '+');
       //要设置两个,不然不会生效
       TcxCalcEditProperties(cxGrid1DBTableView1cgsl.Properties).ImmediateDropDownWhenKeyPressed := False;
       TcxCalcEditProperties(AEdit.ActiveProperties).ImmediateDropDownWhenKeyPressed := False;
      end;
 end;

这里绑定的是TcxCalcEdit

posted @ 2025-01-11 08:40  Tag  阅读(10)  评论(0)    收藏  举报