Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace sourceCode
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- int pCount = 0;
- private void Form1_Load(object sender, EventArgs e)
- {
- foreach(Control C in this.Controls)
- {
- if(C.Name.Contains("panel"))
- {
- pCount++;
- }
- }
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- foreach(Control C in this.Controls)
- {
- if(C.Name.Contains("panel"))
- {
- int theValue = (this.Location.X - Cursor.Position.X) + this.Width - (((pCount + 2) * 65) - 30) / 2;
- ((Panel)C).Left = theValue + (65 * Convert.ToInt16(((Panel)C).Name.Remove(0, 5)));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment