?
Solved

Passing picturebox to a class

Posted on 2005-03-03
4
Medium Priority
?
161 Views
Last Modified: 2010-05-02
Hello,

I would like to build a class which would have a property to which I could assign a picturebox.
Later I would like this class to operate on this picturebox. My idea is to make the class semi-inherit properties of the picturebox. How to make such a reference?

Thanks

Eyore
0
Comment
Question by:eyore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:Ark
ID: 13455141
Private WithEvents m_PB As PictureBox

Public Property Set AttachedPB(pb As PictureBox)
   Set m_PB = pb
End Property

Public Property Get AttachedPB() As PictureBox
   Set AttachedPB() = m_PB
End Property

Private Sub m_PB_MouseDown(...)
   ...
End Sub
0
 

Author Comment

by:eyore
ID: 13459326
Yeah, but if now what do i actually pass to this function?
I mean :

Class.AttachedPB=??

Szymon
0
 
LVL 28

Accepted Solution

by:
Ark earned 1000 total points
ID: 13463635
Set Class.AttachedPB=Picture1 'Where picture1 is picturebox
0
 

Author Comment

by:eyore
ID: 13469993
Oh yeah - now it works - I missed the 'set' command when assigning.

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question