Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display filenames with double click opening the file
Message
 
 
To
19/09/2005 05:53:03
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01050800
Message ID:
01050899
Views:
22
This message has been marked as a message which has helped to the initial question of the thread.
>Hi
>i need to display filenames on a screen with the capability of double clicking on the filename which in turn should open the file like outlooks attachment control
>
>can that be done in VFP?
>PS:
>I use the browser control, it shows the filename but clickin on it won't open it.
>This is my html in the browser document:
<snip>

Hi Peter,

I use ListView control and IconBody class to display attachments with icons
* Method AddOneAttachment
LPARAMETERS	tcFile

LOCAL lcFile, lcImgKey, lnIndexSmall, lnIndexLarge, loIconBuddy

lcFile = IIF( VARTYPE(tcFile) = "C", tcFile, GETFILE() )

llOK = .F.

IF NOT EMPTY(lcFile)
	loIconBuddy = NEWOBJECT("iconbuddy", "iconbuddy.vcx")

	lnIndexSmall = 0
	lnIndexLarge = 0

	lcImgKey	 = LOWER(JUSTEXT(lcFile))

	* No extension case
	IF EMPTY(lcImgKey)
		lcImgKey = 'NONE'
	ENDIF	
	
	*-- Extract the large associated Image to the  first ImageList
	lnIndexLarge = loIconBuddy.Extract2ImageList(lcFile, lcImgKey,;
						THIS.ImageListLarge, .F., -1)
	*-- and now the small one
	lnIndexSmall =  loIconBuddy.Extract2ImageList(lcFile, lcImgKey,;
						THIS.ImageListSmall, .T., -1)

	* Make sure that we got associated icon
	IF lnIndexLarge > 0 AND lnIndexSmall > 0
		Thisform.oLV.OBJECT.Icons 		= THIS.ImageListLarge.OBJECT
		Thisform.oLV.OBJECT.SmallIcons = THIS.ImageListSmall.OBJECT

		Thisform.oLV.ListItems.ADD( ,lcImgKey+SYS(2015), JUSTFNAME(lcFile), lnIndexLarge, lnIndexSmall)

		loIconBuddy = .NULL.

		llOK = .T.
	ELSE
		llOK = .F.
	ENDIF	
ENDIF

RETURN llOK
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform