|
-
Oct 30th, 2000, 09:25 AM
#1
Thread Starter
New Member
I wonder if anyone can help....
I need to be able to click on a picture box created at run. The picture boxes are created using the code:
Set objFurn = frmRoom.Controls.Add("vb.PictureBox", "Furnbox" & index)
how dow i access these picture boxes by clicking on them at run-time?
-
Oct 30th, 2000, 09:33 AM
#2
transcendental analytic
For single controls you can use withevents as follows:
Code:
Private WithEvents objFurn As PictureBox
To use control arrays i think you have to create an invisible dummy control and use Load to load up other instances of it.
To use an array of controls, make a wrapper class for the picturebox and use withevents as above. Then Create your own events using Event statement that will raise the events you get from the picturebox into the classcollection of the wrapper classes, then raise overall events from the wrapper class that could contain the index part you usually see in control array events.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 30th, 2000, 09:39 AM
#3
Code:
Private WithEvents pic As PictureBox
Private Sub Form_Load()
Set pic = Me.Controls.Add("VB.PictureBox", "Picture1")
End Sub
Private Sub pic_Click()
MsgBox "You clicked the PictureBox"
End Sub
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
|