0

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

2
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by anoop4real
Featured Replies
  • Hi, it didn't work as I expected it actually! try this instead it should work and there's no buttons or anything involved. [CODE] 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 … Read More

0

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 by anoop4real: n/a

1

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
Votes + Comments
Thanks for the tip
0

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 by anoop4real: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.