hello all,
Can anybody explain me how to create imagebox at runtime
and load an image in it?
Please show it with an example if possible...
Thanks in Advance,
Anita.
Printable View
hello all,
Can anybody explain me how to create imagebox at runtime
and load an image in it?
Please show it with an example if possible...
Thanks in Advance,
Anita.
Without adding a control array first, you can do it this way.
VB Code:
Option Explicit Dim WithEvents imgNew As Image Private Sub Command1_Click() Dim strPic As String strPic = "C:\Program Files\Microsoft Visual Studio\" & _ "Common\Graphics\Icons\Misc\FACE02.ICO" Set imgNew = Controls.Add("VB.Image", "imgNew") With imgNew .Left = 100 .Top = 200 .Height = 800 .Width = 800 .Stretch = True .Visible = True .Picture = LoadPicture(strPic) End With Command1.Visible = False End Sub Private Sub imgNew_Click() MsgBox "You clicked on your new control" End Sub
VB Code:
Dim i As Image Set i = Form1.Controls.Add("VB.Image", "img1") i.Picture = LoadPicture("[i]filepath[/i]")
the pic in avatar is urs????.........:) ..if so ur beautiful......
thanks! i look better without my santa hat on though :DQuote:
Originally posted by Dinz
the pic in avatar is urs????.........:) ..if so ur beautiful......
darre1 u will be disheartened to know that I am talkin bout the first avatar i.e of anita2002.....:D .......Quote:
Originally posted by darre1
thanks! i look better without my santa hat on though :D
naaaaaaah realllyy??? :p