zoukankan      html  css  js  c++  java
  • ListView

     
    添加项目
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      with listview1.Items do
      begin
         Add.Caption:='1111111';
         Add.Caption:='2111111';
         Add.Caption:='3111111';
      end;
    end;
     
     
     
    //添加 项目
    procedure TForm1.Button3Click(Sender: TObject);
    begin
      with ListView2.Items.Add do
      begin
        Caption:='0';
        SubItems.add('FileName1');
        SubItems.add('FileName2');
      end;
    end;
     
     
    //添加listbox里面的项目
    procedure TForm1.Button1Click(Sender: TObject);
    var
        i:Integer;
    begin
      for i := 0 to ListBox1.Items.Count-1 do
      begin
          listview1.Items.add.Caption:=ListBox1.Items[i];
      end;
    end;
     
     
     
     
     
     
    添加头
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      with ListView1 do
      begin
        Columns.Add.Caption:='ID';
        Columns.Add.Caption:='FileName';
        Columns.Add.Caption:='Count';
     
        Columns[0].Width:=50;
        Columns[1].Width:=100;
        Columns[2].Width:=200;
      end;
    end;
     
     
    //判断是否选中
    procedure TForm1.ListView1ContextPopup(Sender: TObject; MousePos: TPoint;
      var Handled: Boolean);
    begin
          if ListView1.Selected = nil then
            begin
              a1.Enabled:=False;
            end
          else
              a1.Enabled:=True;
    end;
     
     




  • 相关阅读:
    PHP输出日志,json美化
    php获取项目路径
    16进制颜色,正则
    doctrine/instantiator
    cn.archive.ubuntu.com 慢的问题
    yzalis/identicon 像素头像
    Shell 判断进程是否存在
    shell 2>&1
    shell 判断是否继续
    shell
  • 原文地址:https://www.cnblogs.com/xe2011/p/3875844.html
Copyright © 2011-2022 走看看