Click here to Skip to main content
16,005,141 members
Home / Discussions / C#
   

C#

 
Generalconnection to server fails Pin
michael.wikstrom4-Oct-04 4:57
michael.wikstrom4-Oct-04 4:57 
GeneralRe: connection to server fails Pin
Colin Angus Mackay4-Oct-04 6:18
Colin Angus Mackay4-Oct-04 6:18 
GeneralRe: connection to server fails Pin
michael.wikstrom4-Oct-04 23:46
michael.wikstrom4-Oct-04 23:46 
GeneralExporting a C# datagrid to Excel Pin
Scott Lindsay4-Oct-04 2:56
Scott Lindsay4-Oct-04 2:56 
QuestionHow to implement a List box that displays a list of Button controls? Pin
kaalpu4-Oct-04 1:43
kaalpu4-Oct-04 1:43 
QuestionHow to use computer as a FTP server (with coding) Pin
sharad_sharma_2k4-Oct-04 1:18
sharad_sharma_2k4-Oct-04 1:18 
AnswerRe: How to use computer as a FTP server (with coding) Pin
Salil Khedkar4-Oct-04 1:33
Salil Khedkar4-Oct-04 1:33 
Generalgreeting screen Pin
Anonymous3-Oct-04 23:58
Anonymous3-Oct-04 23:58 
Hello,

I already have spoken about my problem in this forum. I developed a Smart Device Application with a Login function. After the login function a screen with some information is displayed for about five seconds and then be automatically forwarded to the next Form. I wrote a little code sample and wouuld ask if this is correct to solve my problem?

using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;

namespace SmartDeviceApplication2
{

public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.MainMenu mainMenu1;

private static AutoResetEvent evt;
private static int count = 5;

public Form1()
{

InitializeComponent();


}

protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows Form Designer generated code


private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(64, 64);
this.textBox1.Text = "textBox1";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Monotype Corsiva", 18F, System.Drawing.FontStyle.Italic);
this.label1.ForeColor = System.Drawing.Color.LawnGreen;
this.label1.Location = new System.Drawing.Point(16, 8);
this.label1.Size = new System.Drawing.Size(160, 24);
this.label1.Text = "Test";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// button1
//
this.button1.Location = new System.Drawing.Point(64, 136);
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label2
//
this.label2.Location = new System.Drawing.Point(64, 104);
this.label2.Text = "label2";
//
// Form1
//
this.BackColor = System.Drawing.Color.Orange;
this.Controls.Add(this.label2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Menu = this.mainMenu1;
this.Text = "Form1";

}
#endregion

static void Main()
{
Application.Run(new Form1());
evt = new AutoResetEvent(false);
Timer t = new Timer(new TimerCallback(TimerCallback), null, 5000, 0);
evt.WaitOne();

ActiveForm = Form2;



}

private void button1_Click(object sender, System.EventArgs e)
{
label2.Text = textBox1.Text;
tw.Write("This is the first message!");
}

private static void TimerCallback(object state)
{
evt.Set();
}
}
}

Thanks in Advance

regards

mathon
Generalown control Pin
Anonymous3-Oct-04 23:21
Anonymous3-Oct-04 23:21 
GeneralCreating user controls at run time by name Pin
GazzaJ3-Oct-04 23:20
GazzaJ3-Oct-04 23:20 
GeneralRe: Creating user controls at run time by name Pin
Stefan Troschuetz3-Oct-04 23:58
Stefan Troschuetz3-Oct-04 23:58 
GeneralRe: Creating user controls at run time by name Pin
GazzaJ8-Oct-04 0:35
GazzaJ8-Oct-04 0:35 
GeneralImage Button for PocketPc Pin
Anonymous3-Oct-04 23:07
Anonymous3-Oct-04 23:07 
GeneralImage Pin
StephenMcAllister3-Oct-04 21:06
StephenMcAllister3-Oct-04 21:06 
GeneralRe: Image Pin
Meysam Mahfouzi3-Oct-04 22:12
Meysam Mahfouzi3-Oct-04 22:12 
GeneralUsing Simple MAPI to send email and receive email Pin
ting6683-Oct-04 16:57
ting6683-Oct-04 16:57 
GeneralAddition Pin
sardonicus3-Oct-04 14:03
sardonicus3-Oct-04 14:03 
GeneralRe: Addition Pin
David Stone3-Oct-04 14:18
sitebuilderDavid Stone3-Oct-04 14:18 
GeneralRe: Addition Pin
sardonicus3-Oct-04 14:55
sardonicus3-Oct-04 14:55 
GeneralRe: Addition Pin
eggie53-Oct-04 15:26
eggie53-Oct-04 15:26 
GeneralRe: Addition Pin
David Stone3-Oct-04 19:28
sitebuilderDavid Stone3-Oct-04 19:28 
GeneralRe: Addition Pin
benjymous3-Oct-04 22:19
benjymous3-Oct-04 22:19 
GeneralRe: Addition Pin
Nnamdi Onyeyiri4-Oct-04 1:23
Nnamdi Onyeyiri4-Oct-04 1:23 
GeneralRe: Addition Pin
benjymous4-Oct-04 1:31
benjymous4-Oct-04 1:31 
GeneralRe: Addition Pin
David Stone4-Oct-04 4:54
sitebuilderDavid Stone4-Oct-04 4:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.