private void messageListenCallback(MessageLabel label) { this.Invoke(new MethodInvoker(delegate() { this.showMessage(label); })); }
public void showMessage(MessageLabel nowTaskLabel) { nowTaskLabel.MaximumSize = new Size(this.textZone.Width, 0); this.messageList.Add(nowTaskLabel); this.textZone.Controls.Add(nowTaskLabel); int messageLocation = this.textZone.Height; for (int i = this.messageList.Count - 1; i >= 0; i--) { messageLocation -= this.messageList[i].Height; if (messageLocation > 0) { this.messageList[i].Location = new Point(0, messageLocation); } else { this.messageList[i].Dispose(); this.messageList.RemoveAt(i); } } }