using System; using System.Drawing; using System.Collections; using System.Windows.Forms; using System.Data; namespace DotNetClient { public interface FrmClt { void writeLog( string a_strMsg); } public class FrmHelloClt : System.Windows.Forms.Form, FrmClt { private System.Windows.Forms.Button btEnd; private System.Windows.Forms.Button btRunDemo; private System.Windows.Forms.ListBox lbLog; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox txIpAddr; private System.Windows.Forms.MainMenu mainMenu1; public FrmHelloClt() { InitializeComponent(); } protected override void Dispose( bool disposing ) { base.Dispose( disposing ); } #region Vom Windows Form-Designer generierter Code private void InitializeComponent() { this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.btEnd = new System.Windows.Forms.Button(); this.btRunDemo = new System.Windows.Forms.Button(); this.lbLog = new System.Windows.Forms.ListBox(); this.txIpAddr = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); // // btEnd // this.btEnd.Location = new System.Drawing.Point(136, 211); this.btEnd.Size = new System.Drawing.Size(80, 32); this.btEnd.Text = "End"; this.btEnd.Click += new System.EventHandler(this.btEnd_Click); // // btRunDemo // this.btRunDemo.Location = new System.Drawing.Point(24, 211); this.btRunDemo.Size = new System.Drawing.Size(88, 32); this.btRunDemo.Text = "Run Demo"; this.btRunDemo.Click += new System.EventHandler(this.btRunDemo_Click); // // lbLog // this.lbLog.Location = new System.Drawing.Point(16, 56); this.lbLog.Size = new System.Drawing.Size(200, 128); // // txIpAddr // this.txIpAddr.Location = new System.Drawing.Point(120, 24); this.txIpAddr.Size = new System.Drawing.Size(96, 26); this.txIpAddr.Text = "127.0.0.1"; // // label1 // this.label1.Location = new System.Drawing.Point(16, 24); this.label1.Size = new System.Drawing.Size(88, 20); this.label1.Text = "Server IP Addr."; // // FrmHelloClt // this.Controls.Add(this.label1); this.Controls.Add(this.txIpAddr); this.Controls.Add(this.btEnd); this.Controls.Add(this.btRunDemo); this.Controls.Add(this.lbLog); this.Menu = this.mainMenu1; this.Text = "Hello-Client"; } #endregion static void Main() { Application.Run(new FrmHelloClt()); } private void btRunDemo_Click(object sender, System.EventArgs e) { ClientImpl.runDemo( this, txIpAddr.Text); } private void btEnd_Click(object sender, System.EventArgs e) { Application.Exit(); } public void writeLog( string a_strMsg) { lbLog.Items.Add( a_strMsg); } } }