|
|
Регистрация Восстановить пароль |
Повторная активизация e-mail |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
|
Опции темы | Поиск в этой теме |
29.06.2014, 18:23 | #1 |
Новичок
Джуниор
Регистрация: 29.06.2014
Сообщений: 1
|
Помогите пожалуйста, составить блок-схему по программному коду в Visual Basic
Программный код проекта
Option Explicit Dim WithEvents Img As Image Dim WithEvents Tbr As VBControlExtender Dim WithEvents Lst As ListBox Dim Cdlg As Object Dim a As Single Private Const tbrButtonGroup = 2, tbrDefault = 0, tbrPressed = 1 Private Sub Form_Load() Licenses.Add "MSComctlLib.ToolBar" Licenses.Add "MSComDlg.CommonDialog" Set Tbr = Me.Controls.Add("MSComctlLib.ToolBa r", "tbr") Set Img = Me.Controls.Add("VB.Image", "img") Set Lst = Me.Controls.Add("VB.ListBox", "lst") Set Cdlg = Me.Controls.Add("MSComDlg.CommonDia log", "cdlg") Tbr.object.Buttons.Add(, , "Предыдущий", tbrButtonGroup).Value = tbrPressed Tbr.object.Buttons.Add , , "Cледующий", tbrButtonGroup Tbr.object.Buttons.Add , , "Добавить", tbrDefault Tbr.object.BorderStyle = vbFixedSingle Img.Stretch = True Tbr.Visible = True: Img.Visible = True: Lst.Visible = True Cdlg.object.CancelError = True: Cdlg.object.DialogTitle = "Добавить изображение" Cdlg.object.Filter = "Изображения|*.bmp;*.jpg;*.jpeg;*.g if" End Sub Private Sub Update() On Error GoTo ErrorImg If Lst.ListIndex < 0 Then Exit Sub Set Img.Picture = LoadPicture(Lst.List(Lst.ListIndex) ) a = Img.Picture.Width / Img.Picture.Height Call Form_Resize Exit Sub ErrorImg: MsgBox "Ошибка открытия изображения", vbExclamation Lst.RemoveItem Lst.ListIndex End Sub Private Sub Form_Resize() Dim w As Long, h As Long If Me.ScaleWidth < 1000 Or (Me.ScaleHeight - Tbr.Height) < 1000 Then Exit Sub Lst.Move Me.ScaleWidth - Me.ScaleWidth / 4, Tbr.Height, Me.ScaleWidth / 4, Me.ScaleHeight - Tbr.Height If Not Img.Picture Is Nothing Then If a > 1 Then w = Me.ScaleWidth - Lst.Width: h = w / a Else h = Me.ScaleHeight - Tbr.Height: w = h * a Img.Move (Me.ScaleWidth - Lst.Width - w) \ 2, (Me.ScaleHeight - Tbr.Height - h) \ 2 + Tbr.Height, w, h End If End Sub Private Sub Img_Click() If Lst.ListCount Then If Tbr.object.Buttons(1).Value Then If Lst.ListIndex Then Lst.ListIndex = Lst.ListIndex - 1 Else If Lst.ListIndex < Lst.ListCount - 1 Then Lst.ListIndex = Lst.ListIndex + 1 End If End If End Sub Private Sub Lst_Click() Update End Sub Private Sub Tbr_ObjectEvent(Info As EventInfo) If Info.Name = "ButtonClick" Then If Info.EventParameters.Item(0).Value. Index = 3 Then On Error GoTo CancelDlg Cdlg.object.ShowOpen Lst.AddItem Cdlg.object.FileName If Lst.ListCount = 1 Then Lst.ListIndex = 0 CancelDlg: End If End If End Sub |
Похожие темы | ||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
Помогите составить блок-схему( Basic) | ncccn | Помощь студентам | 0 | 29.04.2014 21:04 |
Помогите, пожалуйста составить блок-схему. | Anteya123 | Паскаль, Turbo Pascal, PascalABC.NET | 0 | 21.04.2014 20:38 |
Нужно нарисовать блок схему по программному коду. | labrador | Помощь студентам | 1 | 16.03.2012 17:10 |
Помогите пожалуйста решить две задачи по паскалю и составить и составить блок схему! | ...Оленька... | Паскаль, Turbo Pascal, PascalABC.NET | 2 | 20.01.2009 09:37 |