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!

Setting a command button picture property with VBIDE

Status
Not open for further replies.

jayscot

MIS
Feb 2, 2001
25
US
I'm trying to set the picture property of a command button from an Addin which places controls on a form in a vb project.

This is an example of the way I set the rest of the properties when adding the button.

With frmNewForm.VBControls.Add("CommandButton").Properties
.item("Top") = 100
.item("Left") = 100
.item("Name") = "cmdWhatever"
.item("Width") = 295
.item("Height") = 295
.item("Style") = 1
.item("TabStop") = False

'this doesn't work
.item("Picture") = "D:\dev\Seltrol\Graphics\Locator.bmp"

'neither does this
.item("Picture") = LoadResPicture(5001,vbResBitmap)
End With


 
Tried the LoadPicture(). No Luck, the Err.Msg says Automation Failure and Catastrophic Failure.

These messages have a way of giving a guy a sense of hopelessness.

Jay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top