I'm a first semester CINT student and I'd like to add some "bling" to my final project. I want to add blinking text to my final forms clearform button. My code so far:

Private Sub orderForm_Load(ByVal sender As System.Object, ByVal e As  _
    System.EventArgs) Handles MyBase.Load
        'disabling the animation on loading the form
        Timer1.Enabled = False
    End Sub



    Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As  _
    System.EventArgs) Handles clearButton.Click
        Dim Timer1 As Timer
        Timer1 = Me.Timer1
        Label10.Visible = False
        Label10.Text = "Come Back Soon!"  'text to display on clearbtn_click
        Timer1.Enabled = True 'starting the animation
        Timer1.Interval = 400 'interval of the timer

        If Label10.Visible = True Then   'checking whether it is visible
            Label10.Visible = False         'if visible then, make it invisible
        ElseIf Label10.Visible = False Then     'checking whether it is invisible
            Label10.Visible = True     'if invisible then, make it visible
        End If

        'clears all list boxes and amount labels
        Label2.Text = Nothing
        memPurchLabel.Text = Nothing
        equipListBox.Items.Clear()
        equipLabel.Text = Nothing
        apprlListBox.Items.Clear()
        apparelLabel.Text = Nothing
        subTotalLabel.Text = Nothing
        taxLabel.Text = Nothing
        totalLabel.Text = Nothing
        

        
    End Sub

This is my first post. Thanks for any help.

Recommended Answers

All 3 Replies

I'm such a Doofus. Meant to say VB express 2008. Sorry.

the blinking stuff could be done in the Timer1_Tick event

Thanks for your reply. I figured out how to do it with a Do While loop. The code I used is below. Thanks again.

Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles clearButton.Click
'displays exit message
Label10.Text = "Come Back Soon!".ToString 'text to display on clearbtn_click
Dim count As Integer = 1
Do While count <= 10
Label10.Visible = Not Label10.Visible
Me.Refresh()
System.Threading.Thread.Sleep(100)
count = count + 1
Loop

'clears all list boxes and amount labels
Label2.Text = Nothing
memPurchLabel.Text = Nothing
equipListBox.Items.Clear()
equipLabel.Text = Nothing
apprlListBox.Items.Clear()
apparelLabel.Text = Nothing
subTotalLabel.Text = Nothing
taxLabel.Text = Nothing
totalLabel.Text = Nothing

End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.