unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls, ScktComp;
type
TForm1 =
class(TForm)
ClientSocket1: TClientSocket;
RichEdit1: TRichEdit;
RichEdit2: TRichEdit;
ButtonSenden: TButton;
ProgressBar1: TProgressBar;
Label1: TLabel;
ButtonConnect: TButton;
ButtonOptions: TButton;
procedure RichEdit2KeyUp(Sender: TObject;
var Key: Word;
Shift: TShiftState);
procedure ButtonOptionsClick(Sender: TObject);
procedure ButtonConnectClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
nickname:
String;
server:
String;
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.RichEdit2KeyUp(Sender: TObject;
var Key: Word;
Shift: TShiftState);
var rechne: integer;
begin
rechne := trunc(100 / 500 * Length(RichEdit2.Text));
ProgressBar1.Position := rechne;
Label1.Caption := IntToStr(Length(RichEdit2.Text)) + '
/ 500 Zeichen';
if(Length(RichEdit2.Text)>0)
AND (ClientSocket1.Active=true)
then
ButtonSenden.Enabled := true;
end;
procedure TForm1.ButtonOptionsClick(Sender: TObject);
begin
Form2.Show;
end;
procedure TForm1.ButtonConnectClick(Sender: TObject);
begin
ClientSocket1.Active := false;
ClientSocket1.Host := server;
ClientSocket1.Active := true;
end;
end.