I have an editfield that I am loading with styled text.
There are two StyleRuns. The first is a reference, the second is a sentence.

In my sample there are 28 sentences (56 styleRuns) with a total length of
3,695 characters (reference+ text).

If I load the styletext in a StyledText object it takes about 1 tick:

  dim n as integer
  dim arr() as StyleRun
  dim st as StyleRun
  dim stext as StyledText

  dim ref(28) as string  // my references
  dim txt(28) as string  // my sentences

  for i= 0 to 27
    st= new StyleRun
    st.text= ref(i)
    st.font= "verdana"
    st.bold= true
    st.TextColor= &c0000FF
    arr.append st
   
    st= new StyleRun
    st.text= txt(i)+ EndOfLine
    st.font= "verdana"
    arr.append st
  next
  stext= new StyledText
  for each st in arr
    stext.AppendStyleRun st
  next
  // up to this point it takes about 1 tick
  // but when I assign the stext to the editfield:

  editField1.StyledText= stext

  // the above assignment takes 44 ticks.

  // I have also tried the assignment without the stext:
  for each st in arr
    editField1.StyledText.AppendStyledRun st
  next

same deal; 42 ticks

With 288 sentences then stext is constructed in 2 ticks. The editfield takes
3,041 ticks!
I've tried making the editfield visible= false; enabled= false; multiline=
false; styledtext= nil; 

If I can construct a complete styledText object in 2 ticks, why would it
take 3k ticks to move it to the editfield?

I must be missing something.

Help please...
R. Greene

RB 2006r2
WIN XP SP2

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to