PDA

View Full Version : RichText Question


mustafa06
05-30-2009, 07:42 AM
tbSearchResult = RichText.FindText("RichText1", "hi", 1, -1, false, false);

for start,end in tbSearchResult do

if (tbSearchResult) then
RichText.SetSelection("RichText1", tbSearchResult.Start, tbSearchResult.End);
tbFormat = {Bold=true};
RichText.SetSelectionFormat("RichText1", tbFormat, false);
end

end

Richtext have many hi words but only one hi word bold

mustafa06
05-30-2009, 05:07 PM
Help please... :huh

mustafa06
05-30-2009, 05:35 PM
tbSearchResult = RichText.FindText("RichText1", "hi", 1, -1, false, false);

while tbSearchResult.Start ~= nil do

RichText.SetSelection("RichText1", tbSearchResult.Start, tbSearchResult.End);
tbFormat = {Bold=true};
RichText.SetSelectionFormat("RichText1", tbFormat, false);

tbSearchResult2 = RichText.FindText("RichText1", "hi", tbSearchResult.End, -1, false, false);
RichText.SetSelection("RichText1", tbSearchResult2.Start, tbSearchResult2.End);
tbFormat = {Bold=true};

RichText.SetSelectionFormat("RichText1", tbFormat, false);
break

end

It's working i repeat 2 times [ tbSearchResult ] , how i can repeat more and working true ?

mustafa06
05-31-2009, 04:16 AM
help please ?? i search forum but not found ...

mustafa06
05-31-2009, 07:11 AM
If it not possible , im stop project :huh :o .... ??

mustafa06
05-31-2009, 08:10 AM
Im repair this problem :D [ Working ~5 hour ] :cool

first = 1
endx = -1;
repeat
nFind = RichText.FindText("RichText1", "hi", first, endx, false, false);
if nFind ~= nil then
tbFormat = {Bold=true};
RichText.SetSelection("RichText1", nFind.Start, nFind.End);
RichText.SetSelectionFormat("RichText1", tbFormat, false);
first = nFind.End
end
until
nFind == nil