zoukankan      html  css  js  c++  java
  • listview findCaption

    procedure TfrmCaoZYGLNew.edt1KeyPress(Sender: TObject; var Key: Char);
    var
    AItem: TListItem;
    i: Integer;
    isFound: Boolean;
    begin
    if key = #13 then
    begin

    AItem := ListView1.FindCaption(nFount, Trim(edt1.Text), True, False, true);

    if not Assigned(AItem) then
    begin
    isFound := False;
    for i := 0 to ListView1.Items.Count - 1 do
    begin
    if Trim(edt1.Text) = ListView1.Items.Item[i].SubItems[0] then
    begin
    nFount := 0;
    isFound := True;
    ListView1.Selected := ListView1.Items[i];
    ListView1.Items[i].MakeVisible(True); //定位后显示出来
    Break;
    end
    else if (i = ListView1.Items.Count - 1) and not isFound then
    begin
    MSGWarning('没有找到该操作员');
    nFount := 0;
    Break;
    end;
    end;
    end
    else
    begin
    ListView1.Selected := AItem;
    AItem.MakeVisible(True); //定位后显示出来
    if ListView1.Selected.Caption = Trim(edt1.Text) then
    nFount := 0
    else
    nFount := ListView1.Selected.Index;
    end;

    ListView1.SetFocus;
    end;
    end;

  • 相关阅读:
    HDU 1333 基础数论 暴力
    HDU 1299 基础数论 分解
    HDU 1211 EXGCD
    HDU 3507 单调队列 斜率优化
    博弈
    std:ios::sync_with_stdio(false);
    NBUT[1220] SPY
    nbut1217 Dinner
    poj2236Wireless Network
    ZOJ Problem Set
  • 原文地址:https://www.cnblogs.com/maweiwei/p/11094964.html
Copyright © 2011-2022 走看看