Самоучитель VBA


         

устанавливающая отображение или скрытие


'

Private Sub UserForm_Initialize()

'

' Инициализация диалогового окна

Dim i, j As Integer

Set Надписи(1, 1) = Label5

Set Надписи(2, 1} = Label6

Set Надписи(1, 2) = Label7

Set Надписи(2, 2) = Label8

Set Надписи(1, 3) = Label9

Set Надписи(2, 3) = Labell0

Set Надписи(1, 4) = Label11

Set Надписи(2, 4) = Labell2

Set Надписи(1, 5) = Label13

Set Надписи(2, 5) = Label14

Set Надписи(1, 6) = Labell5

Set Надписи(2, 6) = Labell6

Set Надписи(1, 7) = Labell7

Set Надписи(2, 7) = Label18

'

With Label4

.Caption = ""

.BorderStyle = fmBorderStyleSingle

End With

With Imagel

.Picture = LoadPicture("ball.bmp")

.BorderStyle = fmBorderStyleNone

.PictureSizeMode = fmPictureSizeModeZoom

.PictureAlignment = fmPictureAlignmentTopLeft

.Visible = False

End With

'

With Image2

.Picture = LoadPicture("ball.bmp")

.BorderStyle = fmBorderStyleNone

.PictureSizeMode = fmPictureSizeModeZoom

.PictureAlignment = fmPictureAlignmentTopLeft

.Visible = False

End With

'

With Image3

.Picture = LoadPicture("ball.bmp")

.BorderStyle = fmBorderStyleNone

.PictureSizeMode = fmPictureSizeModeZoom

.PictureAlignment = fmPictureAlignmentTopLeft

.Visible = False

End With

'

For i = 1 To 2 For j = 1 To 7

With Надписи(i, j)

.Caption = ""

.BorderStyle = fmBorderStyleNone Select Case i Case 1

.BackColor = vbWhite Case 2

.BackColor = vbYellow End Select

End With

Next j

Next i

'

End Sub

Sub Действие(Flagl, Flag2, Flag3 As Boolean)

'

' Процедура, устанавливающая отображение или скрытие рисунков

'

Imagel.Visible = Flagl

Image2.Visible = Flag2

Image3.Visible = Flag3

End Sub




Содержание  Назад  Вперед