📄 list.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "List.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Form1->ComboBox1->Items=Screen->Fonts;
Form1->ListBox1->Items=Screen->Fonts;
//设置列表框控件的列表项
Form1->Memo1->Lines->LoadFromFile("如果你是我的传说.txt");
//设置文本框显示内容
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ListBox1Click(TObject *Sender)
{
Memo1->Font->Name=ListBox1->Items->Strings[ListBox1->ItemIndex];
//为Memo控件应用选中的字体
ComboBox1->ItemIndex=ListBox1->ItemIndex;
//显示相应的关联选项
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Click(TObject *Sender)
{
ListBox1->ItemIndex=ComboBox1->ItemIndex;
//显示相应的关联选项
Memo1->Font->Name=ListBox1->Items->Strings[ListBox1->ItemIndex];
//为Memo控件应用选中的字体
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -