Welcome / Home
Understanding My PC
Software Downloads
VB.NET
JAVA
C#.NET
RPG
SQL
Software Engineering
Networking
Communications
Security
Internet Links
Contact Us

How To Code a MDI Form


How to Code a Multiple Document Interface Form

 

MDI forms are a great interface for designing encapsulated subsystems.  This is an example of MDI form source code that uses menu item events to load other forms.  Notice the Program Exit key F3.  We use HEADLINE Scripting with lowercase prefixes for most objects.  We also use acronyms for field names  (AccountNumber=ACTNBR).  Please pardon the formatting from the HTML editor.  Indentations were lost, and it selected some funky fonts and colors.
 
Copyrighted by CompuCranks.com (2006)
 
'****************************************************************************************
   Option Explicit On
   Option Strict On
'****************************************************************************************
 
'****************************************************************************************
Public Class mdiSUBSYSTEM
'****************************************************************************************
 
'****************************************************************************************
Private Sub mdiSUBSYSTEM_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
'****************************************************************************************
   Select Case e.KeyCode
     Case Keys.F3
     End
   End Select
End Sub
 
'****************************************************************************************
Private Sub ctlCONFIGURE_SUBSYSTEM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ctlCONFIGURE_SUBSYSTEM.Click
'****************************************************************************************
   Me.Cursor = Cursors.WaitCursor
   frmCONFIGURE_SYSTEM.MdiParent = Me
   frmCONFIGURE_SYSTEM.Show()
   Me.Cursor = Cursors.Default
End Sub
 
'****************************************************************************************
Private Sub ctlEXIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ctlEXIT.Click
'****************************************************************************************
   End
End Sub
 
'****************************************************************************************
Private Sub mtnAUD_MASTER_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mtnAUD_MASTER.Click
'****************************************************************************************
   Me.Cursor = Cursors.WaitCursor
   frmAUD_MASTER.MdiParent = Me
   frmAUD_MASTER.Show()
   Me.Cursor = Cursors.Default
End Sub
 
'****************************************************************************************
Private Sub mtnAUD_TRANSACTION_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mtnAUD_TRANSACTION.Click
'****************************************************************************************
   Me.Cursor = Cursors.WaitCursor
   frmAUD_TRANSACTION.MdiParent = Me
   frmAUD_TRANSACTION.Show()
   Me.Cursor = Cursors.Default
End Sub
 
'****************************************************************************************
Private Sub prtPRT_REPORTS_STATEMENTS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles prtPRT_REPORTS_STATEMENTS.Click
'****************************************************************************************
   Me.Cursor = Cursors.WaitCursor
   frmPRT_REPORTS_STATEMENTS.MdiParent = Me
  frmPRT_REPORTS_STATEMENTS.Show()
   Me.Cursor = Cursors.Default
End Sub
 
'****************************************************************************************
Private Sub hlpABOUT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hlpABOUT.Click
'****************************************************************************************
   Me.Cursor = Cursors.WaitCursor
   frmABOUT.MdiParent = Me
   frmABOUT.Show()
   Me.Cursor = Cursors.Default
End Sub
 
End Class