Thursday, December 29, 2011

Disabled and Unabled Control Using CSharp

I'm converting one of my function in Vb6.0 to C#.net this function will allow the user to disabled and enabled Controls in the form, you can also add a if statement for other Controls in the form. :)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
test t = new test();

private void button1_Click(object sender, EventArgs e)
{

t.tagControl(Form.ActiveForm);
}

private void button2_Click(object sender, EventArgs e)
{
t.tagControl(Form.ActiveForm);
}
}
}



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
test t = new test();

private void button1_Click(object sender, EventArgs e)
{

t.tagControl(Form.ActiveForm);
}

private void button2_Click(object sender, EventArgs e)
{
t.tagControl(Form.ActiveForm);
}
}
}

No comments:

Post a Comment

 

blogger templates | Make Money Online