sampledockinglistbox.cpp

来自「胜天进销存源码,国产优秀的进销存」· C++ 代码 · 共 50 行

CPP
50 行
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "SampleDockingListBox.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TSampleDockingListBoxFrame *SampleDockingListBoxFrame;
//---------------------------------------------------------------------------
__fastcall TSampleDockingListBoxFrame::TSampleDockingListBoxFrame(TComponent* Owner)
  : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TSampleDockingListBoxFrame::actAddExecute(TObject *Sender)
{
  ListBox->Items->Add(Edit->Text);
}
//---------------------------------------------------------------------------

void __fastcall TSampleDockingListBoxFrame::actDeleteExecute(
      TObject *Sender)
{
  ListBox->Items->Delete(ListBox->ItemIndex);
}
//---------------------------------------------------------------------------

void __fastcall TSampleDockingListBoxFrame::actClearExecute(
      TObject *Sender)
{
  ListBox->Items->Clear();
}
//---------------------------------------------------------------------------

void __fastcall TSampleDockingListBoxFrame::actAddUpdate(TObject *Sender)
{
  ((TCustomAction*)Sender)->Enabled = Edit->Text != "";
}
//---------------------------------------------------------------------------

void __fastcall TSampleDockingListBoxFrame::actDeleteUpdate(
      TObject *Sender)
{
  ((TCustomAction*)Sender)->Enabled = ListBox->ItemIndex != -1;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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