VisualBasic form

From Just Solve the File Format Problem
Revision as of 15:38, 28 December 2023 by Sembiance (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
File Format
Name VisualBasic form
Ontology
Extension(s) .frm
PRONOM fmt/1541, fmt/1542

VisualBasic form file is a plain text file describing the form (a window), and containing the code associated with it.

Layout

  • The version of VisualBasic
  • The form description
  • Definition of functions

Example

VERSION 5.00
Begin VB.Form Sysedit 
   AutoRedraw      =   -1  'True
   Caption         =   "Anarchist System Editor"
   ClientHeight    =   285
   ClientLeft      =   555
   ClientTop       =   1275
   ClientWidth     =   4305
   LinkTopic       =   "Sysedit"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   285
   ScaleWidth      =   4305
   Begin VB.Menu FileMenu 
      Caption         =   "&File"
      Begin VB.Menu AutoexecMenu 
         Caption         =   "&AutoExec.bat"
      End
      Begin VB.Menu ConfigMenu 
         Caption         =   "&Config.sys"
      End
      Begin VB.Menu DosstartMenu 
         Caption         =   "&DOSStart.bat"
      End
      Begin VB.Menu MsdosMenu 
         Caption         =   "&MSDOS.sys"
      End
      Begin VB.Menu SystemMenu 
         Caption         =   "&System.ini"
      End
      Begin VB.Menu WinMenu 
         Caption         =   "&Win.ini"
      End
      Begin VB.Menu WinstartMenu 
         Caption         =   "W&inStart.bat"
      End
      Begin VB.Menu ExitMenu 
         Caption         =   "&Exit"
         Shortcut        =   {F12}
      End
   End
End
Attribute VB_Name = "Sysedit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Attribute VB_Description = "Main Form"
Public Autoexec, Config, Dosstart, Msdos, System, Win, Winstart As Boolean

Sub AutoexecClose(Ext As Boolean)
 If Autoexec Then
  AutoexecFrm.Unshow
  If Ext Then Unload Me
 End If
End Sub
Sub ConfigClose(Ext As Boolean)
 If Config Then
  ConfigFrm.Unshow
  If Ext Then Unload Me
 End If
End Sub
Sub DosstartClose(Ext As Boolean)
 If Dosstart Then
  DosstartFrm.Unshow
  If Ext Then Unload Me
 End If
End Sub
Sub MsdosClose(Ext As Boolean)
 If Msdos Then
  MsdosFrm.Unshow
  If Ext Then Unload Me
 End If
End Sub
Sub SystemClose(Ext As Boolean)
 If System Then
  SystemFrm.Unshow
  If Ext Then Unload Me
 End If
End Sub
Sub WinClose(Ext As Boolean)
 If Win Then
  WinFrm.Unshow
  If Ext Then Unload Me
 End If
End Sub
Sub WinstartClose(Ext As Boolean)
 If Winstart Then
  WinstartFrm.Unshow
  If Ext Then Unload Me
 End If
End Sub

Private Sub AutoexecMenu_Click()
 If Autoexec Then 'If AutoExec.bat is loaded
  AutoexecClose (False)
 Else
  AutoexecFrm.Show
  Autoexec = True
 End If
End Sub

Private Sub ConfigMenu_Click()
 If Config Then 'If Config.sys is loaded
  ConfigClose (False)
 Else
  ConfigFrm.Show
  Config = True
 End If
End Sub

Private Sub DosstartMenu_Click()
 If Dosstart Then 'If DOSStart.bat is loaded
  DosstartClose (False)
 Else
  DosstartFrm.Show
  Dosstart = True
 End If
End Sub

Private Sub ExitMenu_Click()
 Unload Me
End Sub

Private Sub Form_Resize()
 If WindowState = 2 Then
  WindowState = 0
  Width = 12000
  Height = 690
  Left = 0
  Top = 0
 Else
  Height = 690
 End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
 AutoexecClose (False)
 ConfigClose (False)
 DosstartClose (False)
 MsdosClose (False)
 SystemClose (False)
 WinClose (False)
 WinstartClose (False)
 End
End Sub

Private Sub MsdosMenu_Click()
 If Msdos Then 'If MSDOS.sys is loaded
  MsdosClose (False)
 Else
  MsdosFrm.Show
  Msdos = True
 End If
End Sub

Private Sub SystemMenu_Click()
 If System Then 'If System.ini is loaded
  SystemClose (False)
 Else
  SystemFrm.Show
  System = True
 End If
End Sub

Private Sub WinMenu_Click()
 If Win Then 'If Win.ini is loaded
  WinClose (False)
 Else
  WinFrm.Show
  Win = True
 End If
End Sub

Private Sub WinstartMenu_Click()
 If Winstart Then 'If WinStart.bat is loaded
  WinstartClose (False)
 Else
  WinstartFrm.Show
  Winstart = True
 End If
End Sub

Sample files

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox