Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a URL link
Message
From
27/11/2006 17:37:08
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01172328
Message ID:
01172777
Views:
13
Thanks Ali _I'll try it out.



>You must use following methods in the form having hyperlink object .
>I had send a mail to you with an attachment contain hyperlink form.
>
>Note : Alternatively, textbox object have "EnableHyperlinks" property. If you set this property to .T., any text having format like "www.example.com" automatically is underlined.
>
>
>
>
>********************************
>*** thisform.MouseMove() Method
>********************************
>
>
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>
>thisform.MouseMoveControl2(thisform, "email",   nXCoord, nYCoord)
>thisform.MouseMoveControl2(thisform, "www",      nXCoord, nYCoord)
>
>
>
>********************************
>*** thisform.MouseDown() Method
>********************************
>
>
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>if nShift = 2 && Ctrl
>	thisform.ChildFormCallControl(thisform, nXCoord, nYCoord)
>endif
>
>
>********************************
>*** thisform.MouseMoveControl2() Method
>*** this method must be added
>********************************
>
>lparameters oOwner, cObject, nXCoord, nYCoord
>
>if vartype(oOwner.&cObject) <> "O"
>	return .F.
>endif
>		
>oObject = oOwner.&cObject
>	
>if thisform.ObjBetween(oOwner, cObject, nXCoord, nYCoord)
>	oObject.forecolor = RGB(0,0,255)
>	oObject.disabledforecolor = RGB(0,0,255)
>	oObject.FontUnderline = .T.
>	return .T.
>else
>	oObject.forecolor = RGB(0,0,0)
>	oObject.disabledforecolor = RGB(0,0,0)
>	oObject.FontUnderline = .F.
>	return .F.
>endif
>	
>
>********************************
>*** thisform.objbetween() Method
>*** this method must be added
>********************************
>
>
>lparameters oOwner, cObject, nXCoord, nYCoord
>
>if vartype(oOwner.&cObject) <> "O"
>	return .F.
>endif
>	
>oObject = oOwner.&cObject
>	
>return iif(between(nXCoord, oObject.Left, oObject.Left+oObject.Width) and between(nYCoord, oObject.top, oObject.top+oObject.Height), .T., .F.)
>
>
>********************************
>*** thisform.ChildFormCallControl() Method
>*** this method must be added
>********************************
>
>
>lparameters oOwner, nXCoord, nYCoord
>
>	**** Adres
>	if thisform.ObjBetween(oOwner, "email", nXCoord, nYCoord)
>
>		cMailAdres = "mailto:"+oOwner.email.value
>		run /n3 rundll32 url.dll, FileProtocolHandler &cMailAdres
>		
>*		oObject = CREATEOBJECT("Shell.Application")
>*		oObject.Open(cMailAdres)
>
>		return .T.
>	endif
>
>	if thisform.ObjBetween(oOwner, "www", nXCoord, nYCoord)
>
>		cWebAdres = icase("www"$oOwner.www.value or "http"$oOwner.www.value, '', 'www.')+alltrim(oOwner.www.value)
>		run /n3 rundll32 url.dll, FileProtocolHandler &cWebAdres
>
>*		oObject = CREATEOBJECT("Shell.Application")
>*		oObject.Open(cWebAdres)
>		
>		return .T.
>	endif
>
>
>
>>Ali - how do I make the links underlined as in the way your mailto example is displayed. Thanks.
>>
>>
>>
>>
>>
>>>>Hi all:
>>>>
>>>>How do I make something (e.g. www.something.com) display on the screen as a URL (underlined), which when clicked would take me to the referenced web site? Thanks in advance.
>>>
>>>
>>>The simplest way doing this, putting following code part into a label (or text box) click method
>>>
>>>
>>>cWebAdres = "www.something.com"
>>>oObject = CreateObject("Shell.Application")
>>>oObject.Open(cWebAdres)
>>>
>>>
>>>alternative method
>>>
>>>
>>>cWebAdres = "www.something.com"
>>>run /n3 rundll32 url.dll, FileProtocolHandler &cWebAdres
>>>
>>>
>>>
>>>For sending mail, use this syntax "mailto:altunali@hotmail.com" instead of webadres
>>>
>>>
>>>cWebAdres = "mailto:altunali@hotmail.com"
>>>run /n3 rundll32 url.dll, FileProtocolHandler &cWebAdres
>>>
- Ravi

True greatness consists in being great in little things.
- Charles Simmons
Previous
Reply
Map
View

Click here to load this message in the networking platform