0

I've got a problem with my WFA, I need to write a program, which moves user input text in form, and I need to use function like Location and Left, the text should move with random speed. I tried to use Timer to move this, but it doesn't work ... I put my code below.

namespace Neon2
{
  public partial class Form1 : Form
  {
    public Form1()
    {
        InitializeComponent();
        textBox1.Location = new Point(15, 15);
    }

    private void textBox1_TextChanged(object sender, EventArgs e)
    {
     textBox1.Anchor = AnchorStyles.Right & AnchorStyles.Bottom & AnchorStyles.Top & AnchorStyles.Left;
        try
        {
            textBox1.TextAlign = HorizontalAlignment.Left;
        }catch(InvalidEnumArgumentException ex)
        {
            MessageBox.Show("Error! " + ex.Message, "error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        textBox1.Location = new Point();
   }

    private void timer1_Tick(object sender, EventArgs e){}
  }
}
artist
  • 149
  • 3
  • 15

0 Answers0