/// <summary> /// initilaize gdi drawers and there positions /// and drawing ball events /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { _greenBlueGDI = new myPic(chris_ica14.Properties.Resources.home, this);//main, green/blue balls _greenBlueGDI.SetPosition(placement.EPosition.eRight, this); //drawer position above colided gdi window _greenBlueGDI.ContinuousUpdate = false; _collidedGDI = new myDrawer(_greenBlueGDI.ScaledWidth, _greenBlueGDI.ScaledHeight);//secondary, red balls _collidedGDI.Position = new Point(_greenBlueGDI.Position.X, _greenBlueGDI.Position.Y + _greenBlueGDI.m_ciHeight + 30); _collidedGDI.ContinuousUpdate = false; _greenBlueGDI.MouseLeftClick += _greenBlueGDI_MouseLeftClick; _greenBlueGDI.MouseRightClick += _greenBlueGDI_MouseRightClick; }
public Form1() { InitializeComponent(); //load a picture from resouices and set it to myPics image Pic = new myPic(Properties.Resources.home, this); Pic.ContinuousUpdate = false; //start threads for movment, input and showing whats happening in gdi windows MoveTH = new Thread(new ThreadStart(MoveThread)); MoveTH.IsBackground = true; MoveTH.Start(); ShowTH = new Thread(new ThreadStart(ShowThread)); ShowTH.IsBackground = true; ShowTH.Start(); Input = new Thread(new ThreadStart(InputThread)); Input.IsBackground = true; Input.Start(); Pic.KeyboardEvent += Pic_KeyboardEvent; KeyPreview = true; }