FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Pasting into a Richtext control
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Pasting into a Richtext control
Posted: Sat Feb 11, 2006 03:26 PM
Hi everyone.

I'm needing to insert richtext formated text into a richtext focused control. I'm trying to do it with a cut from one and then paste into the other.

Here is my code:
	MemoWrit( cFile, cRtfTxt2BInserted )
	oMcrRtf := TRichEdit():New()
	oMcrRTF:LoadRTF( cFile )
	oMcrRtf:cFileName := cFile
	oMcrRtf:SetSel( 0, -1 )
	oMcrRtf:Copy()

	logfile( "trace.log", { cfile, oMcrRtf:GetText() } ) //debuging

	oMcrRtf:End()
	ferase( cfile )

	::oRtf:Paste()
	::oWnd:Setfocus()
	::oRtf:Refresh()
	::oRtf:SetSel( 0, 0 )

Where ::ortf is the focused rtf control where rtf formatted text is to be inserted.

The logfile instruction is only to monitor what text is inside oMcrRtf object. It is always empty eventhough cfile contains the rtf text allright. So obviously when :copy() is executed nothing is copied to the clipboard. I'm using :loadRtf( cfile ) in other places in my code without a problem. Why won't it work in this situation?

Can someone help?

Thank you,



Reinaldo.

Continue the discussion