///NEW///////NEW///////NEW///////NEW///////NEW///////NEW///////NEW///////NEW///// First add a Button and a TextBox to Form1.///NEW///////NEW///////NEW///////NEW///////NEW///////NEW///////NEW///////NEW///using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace APRON
{
/// <summary>/// Summary description for Form1./// </summary>publicclass Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
/// <summary>/// Required designer variable./// </summary>private System.ComponentModel.Container components = null;
public Form1()
{
//// Required for Windows Form Designer support//
InitializeComponent();
//// TODO: Add any constructor code after InitializeComponent call//
}
/// <summary>/// Clean up any resources being used./// </summary>protectedoverridevoid Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// <summary>/// The main entry point for the application./// </summary>
[STAThread]
staticvoid Main()
{
Application.Run(new Form1());
}
privatevoid button1_Click(object sender, System.EventArgs e)
{
///NEW///////NEW///////NEW///////NEW///////NEW///////NEW///////NEW///////NEW///// When the button is clicked we change the text to "Hello!".
textBox1.Text = "Hello!";
///NEW///////NEW///////NEW///////NEW///////NEW///////NEW///////NEW///////NEW///
}
privatevoid Form1_Load(object sender, System.EventArgs e)
{
}
}
}
Download C# Source Code
I hope you found this Visual C# .Net tutorial useful!
Don't forget to mention Apron Tutorials in your References!