create control at run time
i want to create control at run time and limit the control .total i want to create 100 textbox,
fisrt 30 text box in form 1 and next 30 in for 2 so on...
based on total no of textbox no of form should be created accordingly
i am looking for vb.6 code to do this
Control Name and Open Function
Hey There.
On Line 37, you caught the change for the Control Name from 'img' to 'dwg'; however, you did not make the change on Line 74, where you execute the Controls.Add Function. It is still starting the Control's Name with 'img'.
Second, to open the drawing in the newly created control, use:
[VBA]
If Right(filImage.Name, 3) = "dwg" Then
With frmThumbnails.Controls.Add("DDVue.DDVueCtrl.1", _
"dwgThumbnail_" & intCurrPage & "_" & intRow & "_" & intCol)
.Open (filImage.Path)
.Left = (intWidth * intCol - 1) + (intSpacing * intCol)
.Top = (intHeight * intRow - 1) + (intSpacing * intRow)
.Height = intHeight
.Width = intWidth
.Visible = True
End With
End If
[/VBA]
Any other problems?
Scott
.Open Function, Not Method
Hey there.
You're error is arising because you are using:
[VBA]
DDVueControl.Open = filImage.Path
[/VBA]
rather than
[VBA]
DDVueControl.Open (filImage.Path)
[/VBA]
Remove the equal sign from you statement.
Second, unless you are using a different version of the Control than from what is on the website, the code I sent you works perfectly. I am actually running the set of code that I posted and took the snippet directly from the project.
In your screenshot, it does not show .Open in the list because you are not far enough down. In the list in your screenshot, the bottom item is .OLEDragConstants, which alphabetically comes before .Open. It should be farther down the list.
Hope this helps clarify things.
Scott
display png images in pitcture /image box as thubmnail
hi scoot i need some modification in the coding.
with this code u can make image/picture box to display png images..in vb.6
i am attaching the code ..i want to include this in thumbnail viewer code....
so tha ti can display png images as thumbnail
[vba]
With frmThumbnails.Controls.Add("VB.Image", _
"imgThumbnail_" & intCurrPage & "_" & intRow & "_" & intCol)
' .Picture = LoadPicture(filImage.Path)
.PngImageLoad = LoadPicture(filImage.Path)
' .PngPictureLoad LoadPicture(filImage.Path)
' .PngImageLoad LoadPicture(filImage.Path)
[/vba]