Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey guys does any of you know how to make a form flash

 

like how wen u get a new message in msn the window is flashing in the taskbar

 

i would like to know how to do this in vb.net

 

 

thanks

  • Leaders
Posted

Ok i've made a sample for .NET , this code i made and it's not a vb6 code:) , the timer i have set to 700 in this case.

    Private Declare Function FlashWindow Lib "user32" _
     (ByVal hwnd As Integer, _
      ByVal bInvert As Boolean) As Long

   Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
       Call FlashWindow(Me.Handle.ToInt32, True)
   End Sub

   Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
       If Me.WindowState = FormWindowState.Minimized Then
           Timer1.Enabled = True
       Else
           Timer1.Enabled = False
       End If
   End Sub

enjoy:)

  • *Experts*
Posted

For the record, I *hate* when windows flash. I turned the option off in XP because it annoyed me. The only time I find it acceptable is on a LONG-running process to alert me that it's done or when I've set a breakpoint in VS.NET and it hits but a form is on top (then the IDE flashes so that I can tell it's on the breakpoint and not still running).

 

That's just my opinion - maybe you've got a good reason to want to flash.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
For the record, I *hate* when windows flash. I turned the option off in XP because it annoyed me. The only time I find it acceptable is on a LONG-running process to alert me that it's done or when I've set a breakpoint in VS.NET and it hits but a form is on top (then the IDE flashes so that I can tell it's on the breakpoint and not still running).

 

That's just my opinion - maybe you've got a good reason to want to flash.

 

-Nerseus

 

i see what u mean, my program is a task schedular

 

and the reminders are shown exactly like the MSN method, so yeah, once a alert pops up i cant just show a window in the taskbar without telling the user there is one coz not much average users notice something new has just popped up

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...