rt

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    if listbox1.items.text='' then
              begin
                  showmessage('listbox1不能为空');
                  abort;
                 end;
    end;
      

  2.   

    procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
      Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
    begin
    if item.Caption='' then
    begin
       showmessage('listview1的caption空了');
       exit;
    end;
      

  3.   

    OnInsertif Item.caption = '' then
      Raise Exception.create('Error');