Option Explicit
Private Sub Form_Load()
FormBackColor Me
End Sub
Private Sub cmdSaveFile_Click()
m_intFF = FreeFile
m_strDirectory = "Projects"
m_SaveProjectFileName = txtFileName.Text
m_strSDPROJFileName = m_SaveProjectFileName & ".sdproj"
m_strFileNameLocation = App.Path & "\" & m_strDirectory & "\" & m_strSDPROJFileName
If Len(Dir$(App.Path & "\" & m_strDirectory & "\", vbDirectory)) > 0 Then
'do nothing because the Projects directory exists
Else
MkDir (m_strDirectory)
End If
'get all the controls on the form
For Each m_Ctrl In frmMain.Controls
'if all the controls are a label and they are visible then
If m_Ctrl Is Label And m_Ctrl.Visible Then
'lets see how many labels are on the form
m_intControlCountLBLTEXT = frmMain.lblText.Count
'now that we have the amounts, lets get the properties of those controls
'in the control array
For m_intIndex = 1 To m_intControlCountLBLTEXT
With frmMain.lblText(m_intIndex)
m_lngBorderStyle = .BorderStyle
m_lngTop = .Top
m_lngLeft = .Left
m_lngHeight = .Height
m_lngWidth = .Width
m_lngAppearance = .Appearance
m_lngBorderStyle = .BorderStyle
m_lngBackStyle = .BackStyle
m_strCaption = .Caption
End If
Next m_intIndex
'if all the controls are pictureboxes and they are called
'pbShape(Index) and are visible then
ElseIf m_Ctrl Is PictureBox And m_Ctrl.Name = "pbShape" Then
'lets see how many pictureboxes called pbShape are present
m_intControlCountPB = frmMain.pb.Count
'now that we have the amounts, lets get the properties of those controls
'in the control array
'if all the controls are pictureboxes and they are called
'pb(Index) and are visible then
ElseIf m_Ctrl Is PictureBox And m_Ctrl.Name = "pb" Then
'lets see how many pictureboxes called pb are present
m_intControlCountPBSHAPE = frmMain.pbShape.Count
'now that we have the amounts, lets get the properties of those controls
'in the control array
'now lets get the work area
ElseIf m_Ctrl Is PictureBox And m_Ctrl.Name = "pbWorkArea" Then
'should only be one
m_intControlCountWORKAREA = frmMain.pbWorkArea.Count
'pbWorkArea is not in a control array so get the properties
With frmMain.pbWorkArea
m_lngHeight = .Height
m_lngWidth = .Width
m_lngAppearance = .Appearance
m_lngBorderStyle = .BorderStyle
End With
End If
Next m_Ctrl
Open m_strFileNameLocation For Output As #m_intFF
Print #m_intFF, [PRINT THE RELEVANT INFORMATION HERE]
Close #m_intFF
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub