Public Class Form1

' Do I really need this?

Public Declare Sub Sleep Lib "kernel32" ( ByVal dwMilliseconds As Long )

Dim HB As String

Dim MidR, MidG, MidB As Decimal

Private Sub Button1_Click ( ByVal sender As System . Object , ByVal e As System . EventArgs ) Handles b1 . Click

Highlighter1 . SetHighlightColor ( b1, DevComponents . DotNetBar . Validator . eHighlightColor . Orange )

Highlighter1 . SetHighlightColor ( b2, DevComponents . DotNetBar . Validator . eHighlightColor . None )

Highlighter1 . SetHighlightColor ( b3, DevComponents . DotNetBar . Validator . eHighlightColor . None )

HB = "1"

Lbl1 . Text = HB

End Sub

Private Sub Button2_Click ( ByVal sender As System . Object , ByVal e As System . EventArgs ) Handles b2 . Click

' Now this is the real issue: b2, then b1, then b3.

Highlighter1 . SetHighlightColor ( b2, DevComponents . DotNetBar . Validator . eHighlightColor . Blue )

Highlighter1 . SetHighlightColor ( b1, DevComponents . DotNetBar . Validator . eHighlightColor . None )

Highlighter1 . SetHighlightColor ( b3, DevComponents . DotNetBar . Validator . eHighlightColor . None )

Highlighter1 . ContainerControl = b2

HB = "2"

Lbl1 . Text = HB

End Sub

Private Sub Button3_Click ( ByVal sender As System . Object , ByVal e As System . EventArgs ) Handles b3 . Click

Highlighter1 . SetHighlightColor ( b3, DevComponents . DotNetBar . Validator . eHighlightColor . Custom )

Highlighter1 . SetHighlightColor ( b2, DevComponents . DotNetBar . Validator . eHighlightColor . None )

Highlighter1 . SetHighlightColor ( b1, DevComponents . DotNetBar . Validator . eHighlightColor . None )

Highlighter1 . ContainerControl = b3

HB = "3"

Lbl1 . Text = HB

End Sub

' (Snip) nothing too bizarre till now:

' Definitely needs more arguments!

Public Function FadeInOutForm ( ByVal DurationMs As Integer , Optional ByVal MakeInvisible As Boolean = False , Optional ByVal InOutIntervalMs As Integer = 0 , Optional ByVal FadeInForm As Boolean = False , Optional ByVal FadeInDurationMs As Integer = 1000 , Optional ByVal FadeOutForm As Boolean = True )

Dim Sw As New Stopwatch

' Classic

If FadeOutForm = True Then

Sw . Start ( )

Do

Me . Opacity = 1 - ( Sw . Elapsed . TotalMilliseconds / DurationMs )

Loop Until Sw . Elapsed . TotalSeconds >= DurationMs Or Me . Opacity <= 0.014

' But why?

If MakeInvisible = False Then Me . Opacity = 0 Else Me . Visible = False

End If

Sw . Reset ( )

If FadeInForm = True Then

Sleep ( InOutIntervalMs )

Sw . Start ( )

Me . Visible = True

Do

Me . Opacity = Sw . Elapsed . TotalMilliseconds / FadeInDurationMs

Loop Until Sw . Elapsed . TotalSeconds >= FadeInDurationMs Or Me . Opacity >= 0.99

Me . Opacity = 1

Sw . Reset ( )

Exit Function

End If

' We don't want to be trapped inside this function, do we?

Exit Function

End Function