Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programatically center an image control..
Message
From
10/01/2007 11:09:36
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
Miscellaneous
Thread ID:
01182600
Message ID:
01184223
Views:
17
Here:
local tvalue
local cImgName
local lnDistance, lnImgWidth, lnFormWidth

sele csrtable
go top

nadd = 0
lnDistance = 200
lnImgWidth = 75
lnFormWidth = _screen.width

lnImgCount = INT( (lnFormWidth - lnDistance) / (lnImgWidth + lnDistance) )
*lvalue = (lnFormWidth - (lnImgCount * lnImgWidth) - ((lnImgCount-1) * lnDistance)) / 2
lnleft = INT((lnFormWidth - (lnImgCount * lnImgWidth)) / (lnImgCount+1) )

thisform.root.picture=locfle
if .not. eof()
	skip
	do while .not. eof()
		tvalue = thisform.root.top+121
			
		cImgName = alltrim(csrkey)
		thisform.addobject(cImgName, 'Image')

		with evaluate('thisform.' + cImgName)
			.visible=.t.
			.stretch=1
			.width=75
			.height=75
			.top=tvalue
			.left=lnleft
			.picture=locfle
			.borderstyle=1
		endwith
		lnleft = lnleft + 200
		skip
	enddo
endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform