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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Commandbutton picture in any position

Activex

Commandbutton picture in any position

by  craigsboyd  Posted    (Edited  )
Slighthaze = [color blue]NULL[/color]
[img http://www.sweetpotatosoftware.com/ttimages/cmdbuttonpic.gif]
Don't like the commandbutton picture always being centered above the caption? Place it in any position you want with this ActiveX solution (cut-n-paste the code into a prg and run from within VFP):


PUBLIC oform1
oform1=CREATEOBJECT("form1")
oform1.ADDOBJECT("cmdbutton","cmdbutton")
oform1.SHOW
RETURN
DEFINE CLASS form1 AS FORM
DOCREATE = .T.
CAPTION = "Form1"
NAME = "Form1"
ENDDEFINE
DEFINE CLASS cmdButton AS OLECONTROL
PROCEDURE INIT
WITH THIS
.pictureposition = 1 [color green]&&Change This[/color]
.PICTURE = LOADPICTURE(HOME() + "graphics\bitmaps\offctlbr\small\color\open.bmp")
.OBJECT.BACKCOLOR = RGB(255,255,255)
.CAPTION = "Open me!"
ENDWITH
ENDPROC
OLECLASS = "forms.commandbutton.1"
VISIBLE = .T.
HEIGHT =40
TOP = 100
LEFT = 125
AUTOSIZE = .T.
PROCEDURE CLICK
=GETDIR("","Locate application:", "Browse for File or Folder",16464)
ENDPROC
ENDDEFINE
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top