. , , ,

,,,

MDI- (multiple document interface) — ,

: MDI , OLE MS Office

1. MDI , : , , , ( 4 5 6). .

1)         Visual Basic 6.0. StandartEXE.

2)         MDI - . → MDI -

3)         Form1 Child True.

4)         MDI - , , , .

5)         .

MDI :

Dim i As Integer

Private Sub New_form_Click()

Dim newform As New Form1

newform.Show

newform.Caption = " "

End Sub

Private Sub New_student_Click()

add_student

End Sub

Private Sub Exit_Click()

End

End Sub

Private Sub WindowArrange_Click()

MDIForm1.Arrange vbArrangeIcons

End Sub

Private Sub WindowCascade_Click()

MDIForm1.Arrange vbCascade

End Sub

Private Sub WindowTileH_Click()

MDIForm1.Arrange vbTileHorizontal

End Sub

Private Sub WindowTileV_Click()

MDIForm1.Arrange vbTileVertical

End Sub

Form1:

Private Sub Command1_Click()

Unload Me

End Sub

1;

Private Type StudentType

fam As String * 30

Name As String * 20

Fac As String * 10

Gru As String * 10

End Type

Public tmp As StudentType

Public arr() As StudentType

Public col As Integer

Sub add_student()

Do

wrk

If MsgBox(" ???", vbYesNo, "??") = vbNo Then: Exit Do

Loop

End Sub

Sub form_active()

If MDIForm1.ActiveForm Is Nothing Then

Dim tmpfrm As New Form1

tmpfrm.Show

End If

End Sub

Sub wrk()

Dim i As Integer

Dim tmp_str As String

A = MsgBox(" ???", vbYesNo, "???")

If A = vbNo Then

Dim tmpfrm As New Form1

tmpfrm.Show

tmpfrm.Caption = " "

End If

form_active

Inp_inf_stud tmp

ReDim Preserve arr(col)

arr(col) = tmp

col = col + 1

For i = 0 To 3

With arr(col - 1)

Select Case i

Case 0: tmpstr = .fam

Case 1: tmpstr = .Name

Case 2: tmpstr = .Fac

Case 3: tmpstr = .Gru

End Select

End With

MDIForm1.ActiveForm.List1(i).AddItem tmpstr

Next i

End Sub

Private Sub Inp_inf_stud(ByRef StudentData As StudentType)

Dim s(3) As String

Dim i As Integer

i = 0

Do Until i > 3

Select Case i

Case 0: s(0) = InputBox(" ", "")

Case 1: s(1) = InputBox(" ", "")

Case 2: s(2) = InputBox(" ", "")

Case 3: s(3) = InputBox( ", "")

End Select

For n = 0 To 3

If s(n) = "" Then s(n) = " "

Next n

With StudentData

Select Case i

Case 0: .fam = s(0)

Case 1: .Name = s(1)

Case 2: .Fac = s(2)

Case 3: .Gru = s(3)

End Select

End With

For n = 0 To 3

s(n) = ""

Next n

i = i + 1

Loop

End Sub

(.1-3)

.1 MDI :


.2 MDI :

.3 MDI :

2.

( MDI ).

save_Click :


Private Sub save_Click()

Dim FNamber As Integer

Dim adress As String

Dim i As Integer

Dim k As Integer

FNamber = FreeFile()

adress = InputBox(" , ", " ", "E:\student.txt")

Open adress For Random Access Write As FNamber Len = Len(arr(i))

Do

If i = col Then: Exit Do

k = i + 1

Put #FNamber, k, arr(i)

i = i + 1

Loop

Close FNamber

End Sub

(.4,5)

.4


.5

3.

1 EXCEL MS OFFICE.

Excel ( MDI ). Visual Basic 6.0 Excel. → . Microsoft Excel 11.0 Object Library.

Excel_Click :

Private Sub Excel_Click()

Dim appl As New Excel.Application

Dim wb As Excel.Workbook

Dim ws As Excel.Worksheets

Set appl = New Excel.Application

appl.Visible = True

Set wb = appl.Workbooks.Add

With wb.Worksheets("1")

Dim i As Integer

Dim j As Integer

For i = 0 To co - 1

For j = 1 To 4

Select Case j

Case 1: .Cells(i + 1, j) = arr(i).fam

Case 2: .Cells(i + 1, j) = arr(i).Name

Case 3: .Cells(i + 1, j) = arr(i).Fac

Case 4: .Cells(i + 1, j) = arr(i).Gru

End Select

Next j

Next i

End With

End Sub

(.6)

.6 EXCEL


:

, MDI- . , . MDI- , .

, Microsoft Office, MS Excel MS Office.

: MDI , OLE MS Office 1. MDI , :

 

 

 

! , , , .
. , :