ZengCode.Com (The Thai Php Framework)  


Home   Download   Manual   About us    

Facebook   


MAIN MENU
News
Php Tips
Android Programming
Design Pattern By PHP
C# using Linq น่าใช้จริงๆ
C# Tips & Technique
C# Design Pattern
Linux Quick Tips
Java & JavaScript Tips
Database & SQL
ZengCode Framework Guide
Zeng Code Code
Programming
IPhone (Tips and Trick)

Download เอกสารที่น่าสนใจ

     Set Caption(title) of the form  (2009-12-22)

 
 
Set Caption(title) of the form
using System;
using System.Windows.Forms;
using System.Drawing;

public class FormTitleSetting : System.Windows.Forms.Form
{
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.TextBox textBox1;

  public FormTitleSetting()
  {
    Text = "Test WinForm";

    ForeColor = System.Drawing.Color.Yellow;

    button1 = new System.Windows.Forms.Button();
    textBox1 = new System.Windows.Forms.TextBox();

    // button control and its properties
    button1.Location = new System.Drawing.Point(832);
    button1.Name = "button1";
    button1.Size = new System.Drawing.Size(10432);
    button1.TabIndex = 0;
    button1.Text = "Click Me";
        
    // text box control and its properties
    textBox1.Location = new System.Drawing.Point(24104);
    textBox1.Name = "textBox1";
    textBox1.Size = new System.Drawing.Size(18420);
    textBox1.TabIndex = 1;
    textBox1.Text = "textBox1";
        
    // Adding controls to the fomr
    Controls.AddRange(new System.Windows.Forms.Control[]{textBox1, button1} );

    button1.Click += new System.EventHandler(button1_Click);
                    
  }

  private void button1_Click(object sender,System.EventArgs e)
  {
    textBox1.Text = "Button is clicked";
    MessageBox.Show("Button is clicked");
  }

  public static int Main()
  {
    Application.Run(new FormTitleSetting());
    return 0;
  }       
}
 
 


Comment
Name
Comment
Security CodeCAPTCHA Image

easy tracking
avis car rental discount code

This page took 0.167150 seconds to load.