Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I add a load picture (let/get Picture) to a new usercontrol ? 1

Status
Not open for further replies.

sanderk

Technical User
Jul 12, 2001
9
NL
Dear experts..

I created a usercontrol that contains a picturebox. Nothing special, but I can't figure out adopt the picture property from the picturebox (picture1) to the newly created usercontrol so that I can add/change the picture from the property sheet or during run-time.

Is there an example available ?
Many thanks
Sander
 
in the usercontrol set a property like this:
this property takes a filepath containing the path to the image file

Public Property Let setpic1(strpicpath As String)
Picture1.Picture = LoadPicture(strpicpath)
Picture1.Refresh
End Property

in the form containing the usercontrol you can change the picture like this:

Form1.UserControl11.setpic1 = "c:\my documents\108.jpg"
 
Hi Harm..
Okay. I understand that but how do I get a dialogbox where I can select a bmp/dib/jpg in the propertysheet just like the orginial picture property from a picture box...

Thx
Sander
 
(The dialogbox in design-time I mean)
Sorry for the seperated posts..

Sander
 
You need to add a property page to you active x control project (project -> add property page).
 
COOL !
You might understand my happyness if I tell you this is my first attempt to create a usercontrol.. All those new things I'm learning give just by a push in the right direction..

I think I can handle it from here.
Thanks so much...

Sander
(from the netherlands)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top