C# Create a Dynamic Menu With Textboxes
an example of a single TextBox.
Project Source Code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace Something
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
int t1 = 76;
private void timer1_Tick(object sender, EventArgs e)
{
if (t1 > 176)
{
timer1.Stop();
this.textBox1.BorderStyle = BorderStyle.FixedSingle;
}
else
{
this.textBox1.Size = new Size(t1, this.textBox1.Size.Height);
t1+=2;
}
}
private void textBox1_MouseHover(object sender, EventArgs e)
{
timer1.Start();
}
private void textBox1_MouseLeave(object sender, EventArgs e)
{
timer1.Stop();
t1 = 76;
this.textBox1.Size = new Size(t1, this.textBox1.Size.Height);
this.textBox1.BorderStyle = BorderStyle.None;
}
private void textBox1_Click(object sender, EventArgs e)
{
MessageBox.Show("something");
}
Download Projects Source Code