View Single Post
  #3   Spotlight this post!  
Unread 22-02-2005, 20:51
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Teach Genia How to Program and Win a Prize

Code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace First_Project
{
	public class WinForm : System.Windows.Forms.Form
	{
		private System.ComponentModel.Container components = null;
		public System.Windows.Forms.Label lblChalkboard;
		public System.Windows.Forms.Button btnLearn;
		public System.Windows.Forms.Button btnDontLearn;

		public WinForm()
		{
			InitializeComponent();
		}

		protected override void Dispose (bool disposing)
		{
			if (disposing)
			{
				if (components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose(disposing);
		}

		#region Windows Form Designer generated code

		private void InitializeComponent()
		{
			this.lblChalkboard = new System.Windows.Forms.Label();
			this.btnLearn = new System.Windows.Forms.Button();
			this.btnDontLearn = new System.Windows.Forms.Button();
			this.SuspendLayout();

			this.lblChalkboard.Location = new System.Drawing.Point(32, 88);
			this.lblChalkboard.Name = "lblChalkboard";
			this.lblChalkboard.Size = new System.Drawing.Size(240, 48);
			this.lblChalkboard.TabIndex = 0;
			this.lblChalkboard.Text = "Do you want to learn?";

			this.btnLearn.Location = new System.Drawing.Point(32, 176);
			this.btnLearn.Name = "btnLearn";
			this.btnLearn.Size = new System.Drawing.Size(72, 24);
			this.btnLearn.TabIndex = 1;
			this.btnLearn.Text = "Learn";
			this.btnLearn.Click += new System.EventHandler(this.btnLearn_Click);

			this.btnDontLearn.Location = new System.Drawing.Point(128, 176);
			this.btnDontLearn.Name = "btnDontLearn";
			this.btnDontLearn.Size = new System.Drawing.Size(80, 24);
			this.btnDontLearn.TabIndex = 2;
			this.btnDontLearn.Text = "Dont Learn";

			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 273);
			this.Controls.Add(this.btnDontLearn);
			this.Controls.Add(this.btnLearn);
			this.Controls.Add(this.lblChalkboard);
			this.Name = "WinForm";
			this.Text = "Teach Genia OOP C#";
			this.ResumeLayout(false);
		}
		#endregion


		[STAThread]
		static void Main() 
		{
			Application.Run(new WinForm());
		}
		
		private void btnLearn_Click(object sender, System.EventArgs e)
		{
			lblChalkboard.Text = "I'm not a good teacher, go search on google :P";
		}
	
		private void btnDontLearn_Click(object sender, System.EventArgs e)
		{
			lblChalkboard.Text = "Yeah... that was probably a safe bet, huh.";
		}

	}
}
(I started learning C# today...)

EDIT: It's .Text not .text, like I said, I started today.
EDIT 2: This wasn't meant to be taken serious, I highly don't recommend learning C# as your beginning language, however I just found my old PHP tutorials so I'll post those.
__________________
http://www.mikesorrenti.com/

Last edited by Mike : 23-02-2005 at 17:40.
Reply With Quote