Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with merge two RTF
Message
 
 
To
13/06/2008 01:28:19
Reza Meamar
Homa Programming Group
Shiraz, Iran
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01322805
Message ID:
01324175
Views:
34
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form

	Top = 0
	Left = 0
	Height = 333
	Width = 507
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT ortf AS olecontrol WITH ;
		Top = 24, ;
		Left = 12, ;
		Height = 240, ;
		Width = 481, ;
		Name = "oRtf"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 290, ;
		Left = 49, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Merge", ;
		Name = "Command1"

	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 290, ;
		Left = 373, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Exit", ;
		Name = "Command2"

	PROCEDURE Init
		Thisform.oRtf.SelStart = 0
		Thisform.oRtf.SelLength = 99999
		Thisform.oRtf.SelText = ""
	ENDPROC

	PROCEDURE Load
		Thisform.AddProperty("aRtfText[1]")
		DIMENSION Thisform.aRtfText[5]
		Thisform.aRtfText[1] = "{\rtf1\fbidis\ansi\ansicpg1256\deff0\deflang1025{\fonttbl{\f0\fswiss\fcharset0 Arial;}" + ;
			"{\f1\fswiss\fcharset178{\*\fname Arial;}Arial (Arabic);}}\viewkind4\uc1\pard\rtlpar\lang1033\f0\fs20 This is line 1 for rtf copy and paste test.\lang1065\f1\rtlch\par}"
		Thisform.aRtfText[2] = "{\rtf1\fbidis\ansi\ansicpg1256\deff0\deflang1025{\fonttbl{\f0\fswiss\fcharset0 Arial;}" + ;
			"{\f1\fswiss\fcharset178{\*\fname Arial;}Arial (Arabic);}}{\colortbl ;\red255\green0\blue0;}" + ;
			"\viewkind4\uc1\pard\rtlpar\cf1\lang1033\f0\fs20 This is line 2 for rtf copy and paste test.\lang1065\f1\rtlch\par}"
		Thisform.aRtfText[3] = "{\rtf1\fbidis\ansi\ansicpg1256\deff0\deflang1025{\fonttbl{\f0\fswiss\fcharset0 Arial;}" + ;
			"{\f1\fswiss\fcharset178{\*\fname Arial;}Arial (Arabic);}}{\colortbl ;\red0\green0\blue0;}" + ;
			"\viewkind4\uc1\pard\rtlpar\cf1\lang1033\b\f0\fs20 This is line 3 for rtf copy and paste test.\lang1065\f1\rtlch\par}"
		Thisform.aRtfText[4] = "{\rtf1\fbidis\ansi\ansicpg1256\deff0\deflang1025{\fonttbl{\f0\fswiss\fcharset0 Arial;}" + ;
			"{\f1\fswiss\fcharset178{\*\fname Arial;}Arial (Arabic);}}{\colortbl ;\red0\green0\blue0;}" + ;
			"\viewkind4\uc1\pard\rtlpar\cf1\lang1033\i\f0\fs28 This is line 4 for rtf copy and paste test.\lang1065\f1\rtlch\par}"
		Thisform.aRtfText[5] = "{\rtf1\fbidis\ansi\ansicpg1256\deff0\deflang1025{\fonttbl{\f0\fswiss\fcharset0 Arial;}" + ;
			"{\f1\fswiss\fcharset178{\*\fname Arial;}Arial (Arabic);}}{\colortbl ;\red0\green0\blue0;}" + ;
			"\viewkind4\uc1\pard\rtlpar\cf1\lang1033\ul\f0\fs28 This is line 5 for rtf copy and paste test.\lang1065\f1\rtlch\par}"
	ENDPROC


	PROCEDURE command1.Click

		FOR i=1 TO ALEN(Thisform.aRtfText)
			Thisform.oRtf.SelStart = 0
			Thisform.oRtf.SelLength = 9999999
			Thisform.oRtf.SelStart = Thisform.oRtf.SelLength-1
			Thisform.oRtf.SelRtf = Thisform.aRtfText[i]
		ENDFOR
	ENDPROC


	PROCEDURE command2.Click
		Thisform.Release()
	ENDPROC


ENDDEFINE
>Pervious function have some problem and I can not use from it.
>I found another way that it is COPY & PASTE. I you run below code, you can see that when I click on three command button respectively, all things is good.
>But if I do this function with AUTOMATIC ACTION command button it is wrong.
>Can you help me for correcting this code?
>Thank you very much.
>
<snip>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform