2005-09-05, 04:44 PM
|
#3 (permalink)
|
版區管理員
|
程式碼
語法:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton1Click(TObject *Sender)
{
Memo1->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton2Click(TObject *Sender)
{
if(OpenDialog1->Execute()) Memo1->Lines->LoadFromFile(OpenDialog1->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton3Click(TObject *Sender)
{
if(SaveDialog1->Execute()) Memo1->Lines->SaveToFile(SaveDialog1->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton14Click(TObject *Sender)
{
Memo1->CutToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton15Click(TObject *Sender)
{
Memo1->CopyToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton16Click(TObject *Sender)
{
Memo1->PasteFromClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton4Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert(",",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton5Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert("。",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton6Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert("、",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton7Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert(";",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton8Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert(":",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton9Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert("!",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton10Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert("?",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton11Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert("「」",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton12Click(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert("『』",i);
Memo1->Text=s;
Memo1->SelStart=i+1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton17Click(TObject *Sender)
{
ListBox1->Items->Add(Memo1->SelText);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ToolButton18Click(TObject *Sender)
{
if(ListBox1->ItemIndex>=0) ListBox1->Items->Delete(ListBox1->ItemIndex);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ListBox1DblClick(TObject *Sender)
{
int i=Memo1->SelStart+1;
String s=Memo1->Text;
s.Insert(ListBox1->Items->Strings[ListBox1->ItemIndex],i);
Memo1->Text=s;
Memo1->SelStart=i+ListBox1->Items->Strings[ListBox1->ItemIndex].Length()-1;
Memo1->SetFocus();
}
//---------------------------------------------------------------------------
|
__________________
『唸金母心咒:嗡。金母。悉地。吽。』
持此咒者,可免一切瘟疫,一切瘟神抱頭四散。
魔術就是欣賞神奇的效果
如果魔術的秘密被破解了
那魔術就失去欣賞的價值
|
|
送花文章: 1536,
收花文章: 1560 篇, 收花: 3905 次
|