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

📄 hb_gg.cpp

📁 软件工程
💻 CPP
字号:
//---------------------------------------------------------------------------
#include"stdio.h"
#include"io.h"
#include"fcntl.h"
#include <vcl.h>
#pragma hdrstop

#include "haibao.h"
#include "hb_gg.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm2::fanhuiClick(TObject *Sender)
{
Form2->Close();
}
//---------------------------------------------------------------------------

void __fastcall TForm2::qudingClick(TObject *Sender)
{int i,n;
if(shurulei2->Text=="")
        ShowMessage("你的类名没添加");
else
        {n=haibao1->ListBox2->Count;
         for(i=0;i<n;i++)  
           { if(shurulei2->Text==haibao1->ListBox2->Items->Strings[i])
                     {ShowMessage("在节日类里已有相同的标题");
                      shurulei2->Clear();
                      return; //for  循环用来判断在节日类里是否有相同的标题
                      }
            }
         n=haibao1->ListBox1->Count;
         for(i=0;i<n;i++) //
           { if(shurulei2->Text==haibao1->ListBox1->Items->Strings[i])
               {ShowMessage("在公共类里已有相同的标题");
                shurulei2->Clear();
                return; //for  循环用来判断在公共类里是否有相同的标题
                }
            }
     haibao1->ListBox1->Items->Strings[haibao1->ListBox1->Count]=shurulei2->Text;
     remove("gonggonginfo");
     haibao1->ListBox1->Items->SaveToFile("gonggonginfo");                        // 写入标题
     mobanwenben->Lines->SaveToFile(shurulei2->Text); //写入模版
     shurulei2->Clear();
     mobanwenben->Clear();
     Form2->Close();
    }
}
//---------------------------------------------------------------------------
//从这到最后是实现对模版的修改如字体。颜色

void __fastcall TForm2::N2Click(TObject *Sender)
{  TFontStyles TF;
   if (FontDialog1->Execute ( ))
   if (mobanwenben->SelLength >0)
   {           //用字体对话框中的设置修改被选文本的字体
      mobanwenben->SelAttributes->Size =FontDialog1->Font->Size;
      TF = FontDialog1->Font->Style;
      mobanwenben->SelAttributes->Style =TF;
    }
}
//---------------------------------------------------------------------------

void __fastcall TForm2::N3Click(TObject *Sender)
{
  if(ColorDialog1->Execute())
  mobanwenben->SelAttributes->Color=ColorDialog1->Color;
}
//---------------------------------------------------------------------------

void __fastcall TForm2::N4Click(TObject *Sender)
{
  mobanwenben->CopyToClipboard ( );       
}
//---------------------------------------------------------------------------

void __fastcall TForm2::N5Click(TObject *Sender)
{
 mobanwenben->CutToClipboard ( );       
}
//---------------------------------------------------------------------------

void __fastcall TForm2::N1Click(TObject *Sender)
{
mobanwenben->PasteFromClipboard ( );       
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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