I have a button in my main form. When pressed, the child form appears. The child form acts as a notification.
Generally when any Window(of any application) is open, and if we click on another app the open window gets deactivated and goes behind the app(on which we clicked).
But notification(of any app) does not go off the screen(or go behind) when something is pressed. I want something like that.
Example
The "Magnifier" app in windows, does not go behind the screen when another app is clicked while the "Magnifier" app is on.
I want to code the child form so as it does not go off-screen even after deactivating.
My Code(of opening the child form)-
private void button2_Click(object sender, EventArgs e) {
this.Visible = false; // to make the main form invisible
for (int x = 0; x <= x++; x++) { //infinite loop
notificationForm n = new();
n.StartPosition = FormStartPosition.Manual;
n.Location = new Point(0, 0);
n.ShowDialog();
Task.Delay(3000).Wait(); // I made a for loop and included this line of code to open the notification(child form) every 3 seconds after closing it
}
}