Thursday, August 27, 2009

Windows Programming - Example for Tab Index

using System;
using System.Windows.Forms;
using System.Drawing;
class myfrm : Form
{
Button b1, b2, b3;
public myfrm()
{
b1 = new Button();
b1.Text = "Ok";
b1.TabIndex = 1;
b1.SetBounds(100, 100, 100, 50);
this.Controls.Add(b1);

b2 = new Button();
b2.Text = "Cancel";
b2.TabIndex = 0;
b2.SetBounds(100, 200, 100, 50);
this.Controls.Add(b2);

b3 = new Button();
b3.Text = "Abort";
b3.SetBounds(100, 300, 100, 50);
b3.TabIndex = 2;
this.Controls.Add(b3);
}
}
class Program
{
static void Main(string[] args)
{
myfrm f = new myfrm();
f.ShowDialog();
}
}

No comments:

Post a Comment