Click here to Skip to main content
15,892,537 members
Articles / General Programming / Threads

Custom Message Box Using Thread That Closes Automatically

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
29 May 2013CPOL1 min read 17.8K   300   7  
Implimenting a message box that closes automatically using thread.
Public Class frmMain

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

    End Sub

    Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click
        Dim myTitle, myMsg As String
        Dim isAuto As Boolean
        Dim waitTime As Integer

        waitTime = Me.txtWait.Text
        myTitle = Me.txtTitle.Text
        myMsg = Me.rtbMsg.Text
        isAuto = Me.txtWait.Text

        Dim myMsgBox As New customMsgBox(myTitle, myMsg, isAuto, waitTime)
        myMsgBox.Show()

    End Sub

    Private Sub rdoFalse_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoFalse.CheckedChanged
        '## For autoClose=False ,  wait entry  disable'##
        If Me.rdoFalse.Checked = True Then
            Me.txtWait.Text = "2"
            Me.txtWait.Enabled = False
        Else
            Me.txtWait.Enabled = True
        End If
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Firfire Technologies
Nepal Nepal
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions