Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include <stdlib.h>
- #pragma hdrstop
- #include "Unit7.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &Key)
- {
- if (Key == 13) {
- LB1->Clear();
- String s = Edit1->Text;
- Trim(s);
- for (int i = s.AnsiPos(" "); i; i = s.AnsiPos(" ")) {
- LB1->Items->Add(s.SubString(0, i));
- s.Delete(1, i);
- }
- LB1->Items->Add(s);
- }
- }
- //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment