|
-
Feb 28th, 2002, 05:32 AM
#1
Thread Starter
Hyperactive Member
runtime imagebox
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.
Can't imagine life without VB
(Various Boyfriends)
-
Feb 28th, 2002, 05:49 AM
#2
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
-
Feb 28th, 2002, 05:50 AM
#3
Bouncy Member
VB Code:
Dim i As Image
Set i = Form1.Controls.Add("VB.Image", "img1")
i.Picture = LoadPicture("[i]filepath[/i]")
-
Feb 28th, 2002, 06:47 AM
#4
Hyperactive Member
the pic in avatar is urs????......... ..if so ur beautiful......
-
Feb 28th, 2002, 08:03 AM
#5
Bouncy Member
Originally posted by Dinz
the pic in avatar is urs????......... ..if so ur beautiful......
thanks! i look better without my santa hat on though
-
Feb 28th, 2002, 08:12 AM
#6
Hyperactive Member
Originally posted by darre1
thanks! i look better without my santa hat on though
darre1 u will be disheartened to know that I am talkin bout the first avatar i.e of anita2002..... .......
-
Feb 28th, 2002, 08:17 AM
#7
Bouncy Member
naaaaaaah realllyy???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|