Close a Instance of a Class

G

gv

Hi all,

How do I close a instance of a class created like this:

I call this class in my project like this
StatMess.Show("Testing")
this shows a status form

...I do some things here

now here is where I want to close the status form?

Class code:

Imports System.Drawing.Drawing2D, System.Drawing, System.Windows.Forms
Public Class StatMess
Inherits Form

Private foreCol As Color = SystemColors.ControlText
Private backCol As Color = SystemColors.Control
Private fnt As Font = New Font("Arial", 8)

Public Overloads Shared Sub show(ByVal message As String)
Dim frmMess As New StatMess
frmMess.StatusMessage(message)

End Sub

Private Sub StatusMessage(ByVal message As String)
Me.SuspendLayout()
etc........

End Sub

End Class
 
C

Chris Dunaway

Since it inherits from Form, you should be able to just call its .Close
method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top