private void GbAufgabe_MouseMove(object sender, MouseEventArgs e) { if (mousePressed) { int y = e.Y - mouseDownlocation.Y; if (y < 0) { if (gbAufgabe.Top >= 19) { gbAufgabe.Top += y; } } else { if (gbAufgabe.Top + gbAufgabe.Size.Height <= cParent.Height) { gbAufgabe.Top += y; } } if (gbAufgabe.Top / Form1.ACHEIGHT == 0 && ((float)gbAufgabe.Top / Form1.ACHEIGHT) < 0.6f && ID != 0) { OnOrderChange?.Invoke(this, new OnOrderChangedEventArgs(gbAufgabe.Location, ID)); mousePressed = false; } if (gbAufgabe.Top / Form1.ACHEIGHT != ID && gbAufgabe.Top / Form1.ACHEIGHT > 0) { OnOrderChange?.Invoke(this, new OnOrderChangedEventArgs(gbAufgabe.Location, ID)); mousePressed = false; } } }
private void StandardOrderMain() { while (true) { if (this.OrdersDict.Count > 0) { foreach (var item in OrdersDict) { StandardOrderItem(item); } if (OnOrderChange != null && needRefreshOrder && !isUpdatingOrder) { OnOrderChange.Invoke(); needRefreshOrder = false; } } Thread.Sleep(100); } }