⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.pas

📁 与Action相结合,可以解决中文件显示乱码
💻 PAS
字号:
{*******************************************************}
{                                                       }
{       RichView                                        }
{       Combo Item Demo                                 }
{                                                       }
{       Copyright (c) Sergey Tkachenko                  }
{       svt@trichview.com                               }
{       http://www.trichview.com                        }
{                                                       }
{*******************************************************}


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls,
  Dialogs, RVScroll, RichView, RVStyle, ComboItem, RVTable;

type
  TForm1 = class(TForm)
    RVStyle1: TRVStyle;
    rv: TRichView;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var item: TRVComboItemInfo;
    table: TRVTableItemInfo;
begin
  rv.AddNL('Virtual Greengrocery',0,1);
  rv.AddNL('',0,1);
  table := TRVTableItemInfo.CreateEx(2,2,rv.RVData);
  table.BorderColor := clSilver;
  table.BorderStyle := rvtbColor;
  table.BorderWidth := 2;

  table.Cells[0,0].Clear;
  table.Cells[1,0].Clear;
  table.Cells[0,1].Clear;
  table.Cells[1,1].Clear;
  table.Cells[0,0].AddNL('Select fruits:',0,0);
  table.Cells[1,0].AddNL('Select vegetables:',0,0);
  table.Cells[0,0].BestWidth := 200;
  table.Cells[0,1].BestWidth := 120;
  table.CellPadding := 5;
  table.ParaNo := 1;

  item := TRVComboItemInfo.CreateEx(rv.RVData, 1, '');
  item.MinWidth := 100;
  item.Items.Add('apple');
  item.Items.Add('banana');
  item.Items.Add('pear');
  table.Cells[0,1].AddItem('', item);

  item := TRVComboItemInfo.CreateEx(rv.RVData, 1, '');
  item.Items.Add('cucumber');
  item.Items.Add('tomato');
  item.MinWidth := 100;
  table.Cells[1,1].AddItem('', item);
  rv.AddItem('', table);
  rv.AddNL('(click the gray square to select)',0,1);
  rv.Format;

end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -