👨‍🏫 Tutorial Flashing Form using VB.Net

Status
Not open for further replies.

CodeWarrior

Grasshopper
This is my simple form effect it called the flashing form effect, i use this effect if i want to create
personalize message box to determine an error or window message.

Lest start:

First Open your vb.net language and create new project, name your project any name you want.
First of all we need to import some references to our project reference name is "System.Runtime.InteropServices".
On the form drag and drop a timer we need one timer to handle a flashing effect

Second double click your form and press ctrl+a and delete everything.

Third copy and paste this code to your empty form.

Code:
Imports System.Runtime.InteropServices
Public Class Form1
    <DllImport("user32.dll", EntryPoint:="FlashWindow")> _
    Public Shared Function FlashingWindow(ByVal fls As Integer, ByVal bit As Integer) As Integer
    End Function
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With Timer1
            .Interval = 500
            .Enabled = True
            .Start()
        End With
    End Sub
    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        FlashingWindow(Me.Handle, 1)
    End Sub
End Class

Now your done, Press F5 and start debugging

Happy Happy Coding...

Credited to ME :)
 
Status
Not open for further replies.

About this Thread

  • 0
    Replies
  • 1K
    Views
  • 1
    Participants
Last reply from:
CodeWarrior

Online now

Members online
998
Guests online
4,213
Total visitors
5,211

Forum statistics

Threads
2,349,853
Posts
29,364,789
Members
1,089,370
Latest member
EDZZZZZZZ0002
Back
Top