To answer your second problem:
If you set the form.StartPosition property to FormStartPosition.Manual , then you can put the form in the cursor (for example):
form.StartPosition = FormStartPosition.Manual; form.Location = new Point(Cursor.Position.X - 1, Cursor.Position.Y - 1);
This may help with your first problem.
If you want the form to behave like a tooltip, then if you add the following event handler code, this may give you a wish:
private void Form_MouseLeave(object sender, EventArgs e) { // Only close if cursor actually outside the popup and not over a label if (Cursor.Position.X < Location.X || Cursor.Position.Y < Location.Y || Cursor.Position.X > Location.X + Width - 1 || Cursor.Position.Y > Location.Y + Height - 1) { Close(); } }
This explains -1 when adjusting the position of the form. This ensures that the cursor is actually displayed in the form when it is first displayed.
source share