Click here to Skip to main content
15,896,153 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.
��<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _

Partial Class customMsgBox

    Inherits System.Windows.Forms.Form



    'Form overrides dispose to clean up the component list.

    <System.Diagnostics.DebuggerNonUserCode()> _

    Protected Overrides Sub Dispose(ByVal disposing As Boolean)

        If disposing AndAlso components IsNot Nothing Then

            components.Dispose()

        End If

        MyBase.Dispose(disposing)

    End Sub



    'Required by the Windows Form Designer

    Private components As System.ComponentModel.IContainer



    'NOTE: The following procedure is required by the Windows Form Designer

    'It can be modified using the Windows Form Designer.  

    'Do not modify it using the code editor.

    <System.Diagnostics.DebuggerStepThrough()> _

    Private Sub InitializeComponent()

        Me.btnOk = New System.Windows.Forms.Button

        Me.lblmsg = New System.Windows.Forms.Label

        Me.SuspendLayout()

        '

        'btnOk

        '

        Me.btnOk.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

        Me.btnOk.ForeColor = System.Drawing.Color.Navy

        Me.btnOk.Location = New System.Drawing.Point(211, 125)

        Me.btnOk.Name = "btnOk"

        Me.btnOk.Size = New System.Drawing.Size(79, 35)

        Me.btnOk.TabIndex = 1

        Me.btnOk.Text = "Ok"

        Me.btnOk.UseVisualStyleBackColor = True

        '

        'lblmsg

        '

        Me.lblmsg.AutoEllipsis = True

        Me.lblmsg.Font = New System.Drawing.Font("Arial", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

        Me.lblmsg.ForeColor = System.Drawing.Color.Black

        Me.lblmsg.Location = New System.Drawing.Point(12, 10)

        Me.lblmsg.Name = "lblmsg"

        Me.lblmsg.Size = New System.Drawing.Size(510, 91)

        Me.lblmsg.TabIndex = 2

        Me.lblmsg.Text = "infoMessage"

        Me.lblmsg.TextAlign = System.Drawing.ContentAlignment.MiddleLeft

        '

        'frmInfo

        '

        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font

        Me.BackColor = System.Drawing.Color.White

        Me.ClientSize = New System.Drawing.Size(534, 172)

        Me.Controls.Add(Me.lblmsg)

        Me.Controls.Add(Me.btnOk)

        Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

        Me.MaximizeBox = False

        Me.MinimizeBox = False

        Me.Name = "frmInfo"

        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen

        Me.Text = "infoTitle"

        Me.ResumeLayout(False)



    End Sub

    Friend WithEvents btnOk As System.Windows.Forms.Button

    Friend WithEvents lblmsg As System.Windows.Forms.Label

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