Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #include <stdlib.h>
  5. #pragma hdrstop
  6.  
  7. #include "Unit7.h"
  8. //---------------------------------------------------------------------------
  9. #pragma package(smart_init)
  10. #pragma resource "*.dfm"
  11. TForm1 *Form1;
  12. //---------------------------------------------------------------------------
  13. __fastcall TForm1::TForm1(TComponent* Owner)
  14.         : TForm(Owner)
  15. {
  16. }
  17. //---------------------------------------------------------------------------
  18.  
  19.  
  20. void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &Key)
  21. {
  22.         if (Key == 13) {
  23.                 LB1->Clear();
  24.                 String s = Edit1->Text;
  25.                 Trim(s);
  26.                 for (; s.AnsiPos(" ") != 0;) {
  27.                         LB1->Items->Add(s.SubString(0, s.AnsiPos(" ")));
  28.                         s.Delete(1, s.AnsiPos(" "));
  29.                 }
  30.                 LB1->Items->Add(s);
  31.         }
  32. }
  33. //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement