For topleft, topright and center use:
| | public void MoveToTopLeftCorner() { txtBox.Left = 0; txtBox.Top = 0; } public void MoveToCenter() { txtBox.Left = (txtBox.Parent.Width / 2) - (txtBox.Witdh); txtBox.Top = (txtBox.Parent.Height/ 2) - (txtBox.Height); } |
For random, place a Timer on you Form and in the Tick event of the timer place code that look like this:
| | private void timer1_Tick(object sender, System.EventArgs e) { Random rnd = new Random(); txtBox.Left = rnd.Next(0, Width - txtBox.Width); txtBox.Top = rnd.Next(0, Height - txtBox.Height); } |
For settings the opacity use the Opacity property of the Form class: