Показать сообщение отдельно
  #3  
Старый 25.05.2025, 05:38
Dummens Dummens вне форума
Прохожий
 
Регистрация: 03.09.2024
Сообщения: 4
Версия Delphi: Delphi 7
Репутация: 10
По умолчанию

Код:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
unit Unit1;
 
interface
 
uses
  //Winapi.Windows,
  //Winapi.Messages,
  System.SysUtils, // IntToStr, FreeAndNil
  Vcl.Controls,    // alClient
  Vcl.Forms,
  CommCtrl,        // for LVSCW_AUTOSIZE
  ComCtrls;        // for TListView
 
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
  ListView1: TListView;
  ListItem1: TListItem;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  form1.Height    := 115;
  form1.Width     := 350;
  form1.Position  := poScreenCenter;
  form1.Caption   := 'Subitems[2] in 255 characters';
 
  ListView1       := TListView.Create(Self);
  with ListView1 do
    begin
      Parent      := Self;
      Align       := alClient;
      ViewStyle   := vsReport;
      BorderWidth := 2;
      GridLines   := true;
    end;
 
  with ListView1.Columns do
    begin
      Add.Caption := 'Line № ';
      Add.Caption := 'Error ';
      Add.Caption := 'String ';
    end;
 
  try
    ListView1.Items.BeginUpdate;
    ListItem1         := ListView1.Items.Add;
    ListItem1.Caption := '22421 ';
    ListItem1.SubItems.Add('All Columns ' + IntToStr(ListView1.Columns.Count));
    ListItem1.SubItems.Add('<RHINOSTRING English="Exploding this mesh will create %d individual meshes.  This may be more than your system can safely manage using the available memory.  You can use Weld to make the mesh explode into fewer pieces, or see Help for more information.\n\nClick OK to proceed with Explode, or Cancel to leave the mesh as is.[[24836]]" Localized="Exploding this mesh will create %d individual meshes.  This may be more than your system can safely manage using the available memory.  You can use Weld to make the mesh explode into fewer pieces, or see Help for more information.\n\nClick OK to proceed with Explode, or Cancel to leave the mesh as is.[[24836]]" />');
    //uses CommCtrl;
    ListView1.Columns[0].Width := {LVSCW_AUTOSIZE or} LVSCW_AUTOSIZE_USEHEADER;
    ListView1.Columns[1].Width := {LVSCW_AUTOSIZE or} LVSCW_AUTOSIZE_USEHEADER;
    ListView1.Columns[2].Width := LVSCW_AUTOSIZE {or LVSCW_AUTOSIZE_USEHEADER};
  finally
    ListView1.Items.EndUpdate;
  end;
end;
 
procedure TForm1.FormDestroy(Sender: TObject);
begin
  FreeAndNil(ListView1);
end;
 
end.
Ответить с цитированием