hi
i am able to create control now..but i am enable to assign the drawing to that control..again i am stuck.
.create folder called image and place dwg drawings,
this is code i am using
Option Explicit
Const intTop = 10
Const itnLeft = 10
Const intPerRow = 5
Const intMaxRows = 1
Const intWidth = 630
Const intHeight = 750
Const intSpacing = 50
Private intCurrPage As Integer
Private Sub Form_Load()
intCurrPage = 1
Get_Page intCurrPage
End Sub
Private Sub cmdPrevious_Click()
intCurrPage = intCurrPage - 1
Get_Page intCurrPage
End Sub
Private Sub cmdNext_Click()
intCurrPage = intCurrPage + 1
Get_Page intCurrPage
End Sub
Public Sub Get_Page(intPage As Integer)
' On Error Resume Next
Dim ctlImage As Control
For Each ctlImage In frmThumbnails.Controls
If Left(ctlImage.Name, 3) = "dwg" Then
frmThumbnails.Controls.Remove (ctlImage.Name)
End If
Next ctlImage
Dim fsoSystem As FileSystemObject
Dim folAppPath As Folder
Dim folImages As Folder
Dim folFiltered As Folder
Dim filImage As File
Dim intCount As Integer
Dim intRows As Integer
Dim intCols As Integer
Dim intCurrPage As Integer
Dim intRow As Integer
Dim intCol As Integer
intCurrPage = 1: intRow = 1: intCol = 1
Set fsoSystem = New FileSystemObject
Set folAppPath = fsoSystem.GetFolder(App.Path)
Set folImages = folAppPath.SubFolders("Images")
If Not folImages Is Nothing Then
intCount = folImages.Files.Count
If intCount <> 0 Then
intRows = Int(intCount / intPerRow)
For Each filImage In folImages.Files
If intCurrPage < intPage Then
' We are not to the active page, so we will skip this image.
ElseIf intCurrPage = intPage Then
If Right(filImage.Name, 3) = "dwg" Then
With frmThumbnails.Controls.Add("DDVue.DDVueCtrl.1", _
"imgThumbnail_" & intCurrPage & "_" & intRow & "_" & intCol)
'.Picture = LoadPicture(filImage.Path)
.Left = (intWidth * intCol - 1) + (intSpacing * intCol)
.Top = (intHeight * intRow - 1) + (intSpacing * intRow)
.Height = intHeight
.Width = intWidth
' .Stretch = True
.Visible = True
End With
End If
Else
Exit Sub
End If
If intCurrPage * intCol * intRow >= intCount Then
intCol = 1
intRow = 1
intCurrPage = 1
ElseIf intCol = intPerRow And _
intRow < intMaxRows Then
intCol = 1
intRow = intRow + 1
ElseIf intCol = intPerRow And _
intRow = intMaxRows Then
intCol = 1
intRow = 1
intCurrPage = intCurrPage + 1
Else
intCol = intCol + 1
End If
Next filImage
End If
Else
MsgBox "Sub-Folder 'Images' could not be found."
End If
End Sub