📄 inserttext.~pas
字号:
unit inserttext;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Buttons, ComCtrls;
type
TinserttextForm = class(TForm)
Image1: TImage;
StaticText1: TStaticText;
Panel1: TPanel;
Image2: TImage;
StaticText2: TStaticText;
hxxmListBox: TListBox;
selectBitBtn: TBitBtn;
cancelBitBtn: TBitBtn;
dataListView: TListView;
procedure cancelBitBtnClick(Sender: TObject);
procedure selectBitBtnClick(Sender: TObject);
procedure hxxmListBoxClick(Sender: TObject);
private
{ Private declarations }
public
selectedtext:string;//选中的文本内容
{ Public declarations }
end;
var
inserttextForm: TinserttextForm;
implementation
uses main, client, data, other;
{$R *.dfm}
procedure TinserttextForm.cancelBitBtnClick(Sender: TObject);
begin
selectedtext:='';
ModalResult := mrCancel;
end;
procedure TinserttextForm.selectBitBtnClick(Sender: TObject);
begin
//取得选中的文本
if dataListView.ItemIndex>=0 then
selectedtext:=dataListView.Selected.Caption;
ModalResult := mrOK;
end;
procedure TinserttextForm.hxxmListBoxClick(Sender: TObject);
begin
// 清除列表中的数据
datalistview.Clear;
// 添加数据到列表中
if hxxmListBox.Items.Strings[hxxmListBox.ItemIndex]='+日常用语' then
begin
rcyyadoquery.First;
while not rcyyadoquery.Eof do
begin
datalistview.AddItem(rcyyadoquery.Fields.Fields[0].AsString,nil);
rcyyadoquery.Next;
end
end
else if hxxmListBox.Items.Strings[hxxmListBox.ItemIndex]='+节日问候' then
begin
jrwhadoquery.First;
while not jrwhadoquery.Eof do
begin
datalistview.AddItem(jrwhadoquery.Fields.Fields[0].AsString,nil);
jrwhadoquery.Next;
end
end
else if hxxmListBox.Items.Strings[hxxmListBox.ItemIndex]='+公司信息' then
begin
gsxxadoquery.First;
while not gsxxadoquery.Eof do
begin
datalistview.AddItem(gsxxadoquery.Fields.Fields[0].AsString,nil);
gsxxadoquery.Next;
end
end
else if hxxmListBox.Items.Strings[hxxmListBox.ItemIndex]='+真情祝福' then
begin
zqzfadoquery.First;
while not zqzfadoquery.Eof do
begin
datalistview.AddItem(zqzfadoquery.Fields.Fields[0].AsString,nil);
zqzfadoquery.Next;
end
end
else if hxxmListBox.Items.Strings[hxxmListBox.ItemIndex]='+商业问候' then
begin
sywhadoquery.First;
while not sywhadoquery.Eof do
begin
datalistview.AddItem(sywhadoquery.Fields.Fields[0].AsString,nil);
sywhadoquery.Next;
end
end
else if hxxmListBox.Items.Strings[hxxmListBox.ItemIndex]='+经典对白' then
begin
jddbadoquery.First;
while not jddbadoquery.Eof do
begin
datalistview.AddItem(jddbadoquery.Fields.Fields[0].AsString,nil);
jddbadoquery.Next;
end
end
else if hxxmListBox.Items.Strings[hxxmListBox.ItemIndex]='+幽默搞笑' then
begin
ymgxadoquery.First;
while not ymgxadoquery.Eof do
begin
datalistview.AddItem(ymgxadoquery.Fields.Fields[0].AsString,nil);
ymgxadoquery.Next;
end
end
else if hxxmListBox.Items.Strings[hxxmListBox.ItemIndex]='+保留信息' then
begin
blxxadoquery.First;
while not blxxadoquery.Eof do
begin
datalistview.AddItem(blxxadoquery.Fields.Fields[0].AsString,nil);
blxxadoquery.Next;
end
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -