PDA

View Full Version : Appending text clips to Tx Control


Unregistered
October 27, 2002, 13:14:05
hi,
I'm currently evaluating version 10 of the TX text control with VB 6. I'm currently stuck at a certain point and hope someone will be able to help me out.

I have 3 text boxes on a form and a button to apply the text to the TX Control on the form.

' ' ' sample
text1 = "This is sentence one"
text2 = "Line No 2"
text3 ="c:\docs\test.DOC"

On pressing the command button i want to insert the contents of text1, text2, then a small word document into the TX control.

The result should be like,

This is sentence One
Line No 2
This is a line from a DOC file

Following is the code I use,

txDoc=""
txDoc = txDoc & text1 & vbcrlf
txDoc = txDoc & text2 & vbcrlf
txDoc.Load text3,0,9,true

My problem is that no matter what i've tried the ORDER is always as follows

This is a line from a DOC file <-- this should be the last line !!!
This is sentence One
Line No 2


How can I preserve the insert order?

regards
R.James


This message was originally posted by R.James in the old TX Text Control Support Forum.

Unregistered
October 28, 2002, 12:58:54
In your example you use

txDoc=""
txDoc = txDoc & text1 & vbcrlf
txDoc = txDoc & text2 & vbcrlf
txDoc.Load text3,0,9,true

the following should do what you want

txDoc.Load text3,0,9,flase
txdoc.selstart=0
Doc = text1 & vbcrlf
Doc = Doc & text2 & vbcrlf

txdoc.seltext= Doc

or

txDoc=""
txDoc = txDoc & text1 & vbcrlf
txDoc = txDoc & text2 & vbcrlf
txdoc.selstart=9999
txDoc.Load text3,0,9,true


I wuld however recomend that you fully qualift the properties that you are updating. The use of the default is very confusing to read.


This message was originally posted by Matt in the old TX Text Control Support Forum.