Option Explicit
Private Sub Command1_Click()
Dim St As String
CommonDialog1.ShowOpen
List1.AddItem CommonDialog1.FileName
Open CommonDialog1.FileName For Input As 1
While Not EOF(1)
Line Input #1, St
List1.AddItem St
Wend
Close
End Sub
CommonDialog1.Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNNoChangeDir Or cdlOFNNoDereferenceLinks Or cdOFNLongNames
Private Sub Command1_Click()
On Error GoTo ErrorHandler
CommonDialog1.CancelError = True
CommonDialog1.Filter = "Ãðàôè÷åñêèå ôàéëû (*.jpg,*.gif,*.png)|*.jpg;*.gif;*.png|"
CommonDialog1.Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNNoChangeDir Or cdlOFNNoDereferenceLinks Or cdOFNLongNames
CommonDialog1.ShowOpen
load_pic CommonDialog1.FileName
Exit Sub
ErrorHandler:
If Err.Number = 32755 Then
Exit Sub
End If
End Sub
Public Sub load_pic(mpath)
On Error Resume Next
Set PictureScroller1.Picture = LoadPictureGDIPlus(mpath)
Set Picture1.Picture = LoadPictureGDIPlus(mpath)
Text1(0).text = Picture1.Width \ Screen.TwipsPerPixelX
Text1(1).text = Picture1.Height \ Screen.TwipsPerPixelY
End Sub
Private Sub Command1_Click()
On Error GoTo ErrorHandler
CommonDialog1.CancelError = True
CommonDialog1.Filter = "*.txt|*.txt|"
CommonDialog1.Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNNoChangeDir Or cdlOFNNoDereferenceLinks Or cdOFNLongNames
CommonDialog1.ShowOpen
mpath = CommonDialog1.FileName
Open mpath For Input As #2
Input #2, t
Close #2
Text1.Text = t
Exit Sub
ErrorHandler:
If Err.Number = 32755 Then Exit Sub
End Sub
Сейчас этот форум просматривают: Google-бот, Yandex-бот и гости: 24