Hi,

I have small application which shows an alert in every 45 mins....( to take a break from work :) )..... It is a normal windows form with a timer in it and in every 45 mins I am invoking a message box. I am able to make it work but the problem is that when the application is minimized, the message box is not popping up, it stays with in the parent form (minimized). How can I bring it up to the user focus?

-anoop4real

Hi, In the timer tick code add this

WindowState = FormWindowState.Normal

Thanks for the reply, I have redesigned my application with a toaster window, which worked fine!! , I will try your solution in my old project.

-a4r

Edited 6 Years Ago by anoop4real: n/a

Hi, it didn't work as I expected it actually! try this instead it should work and there's no buttons or anything involved.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.TopMost = True
        Timer1.Enabled = False
        MsgBox("Time to take a break! Yay!!", MsgBoxStyle.Information, "Breaktime")
        MsgBox("Click OK when you've had a break!", MsgBoxStyle.Question, "Waiting!")
        Timer1.Enabled = True
        Me.TopMost = False
    End Sub
Comments
Thanks for the tip

Hi, it didn't work as I expected it actually! try this instead it should work and there's no buttons or anything involved.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.TopMost = True
        Timer1.Enabled = False
        MsgBox("Time to take a break! Yay!!", MsgBoxStyle.Information, "Breaktime")
        MsgBox("Click OK when you've had a break!", MsgBoxStyle.Question, "Waiting!")
        Timer1.Enabled = True
        Me.TopMost = False
    End Sub

Hey Cool man this was the same kind of application that I was trying to make ie just to tell me to take a break from work after a specific interval :-)............ but anyways now I have a toaster window which will slide up from the right hand side of the screen and tell me to take a break :-).....

-a4r

Edited 6 Years Ago by anoop4real: n/a

This question has already been answered. Start a new discussion instead.