hello,
I want to know how to creat a picture box or/and a text box during the run time using code,,,i really need to know how do it,,please help me and reply A.S.A.P
thanx
Printable View
hello,
I want to know how to creat a picture box or/and a text box during the run time using code,,,i really need to know how do it,,please help me and reply A.S.A.P
thanx
Use this code. It will only work if you have VB6.[b]
Code:Private Sub Command1_Click()
Controls.Add "VB.Label", "Label1"
Me!Label1.Move 0, 0
Me!Label1.Caption = "This is my label!"
Me!Label1.Visible = True
End Sub
'add a picture box to a form dynamically at run time
Option Explicit
Private WithEvents picObj As PictureBox
Private Sub Form_Activate()
picObj.Print "A new picture box created dynamically!"
End Sub
Private Sub Form_Load()
Set picObj = Controls.Add("VB.PictureBox", "picObj")
With picObj
.Visible = True
.Width = 3000
.Top = 1000
.Left = 1000
End With
End Sub
ok, thanx alot guys, what about if i want to creat an array of picturebox, like picture(0) and picture(1) and........
please help me guys,,,,,,,if you don't understand me here u'll find it in another way:
i want to creat a pictureboxes but all of them has the same name,,,like array for example : picture(0), picture(1) and picture(2) ,,,,,like that
got it guys please help me A.S.A.P.
thanx
You can load them from a Pre-existing PictureBox with an Index of 0. [b]
Code:Load Picture1(1)
Picture1(1).Move 0, 0
Picture1(I).Visible = True
Thanx Alot guys