WPCubed Product Support

Error using SelectAll / SelText

Hi;

Working with WP4 I can SelectAll and then assigning SelText to a new value; or also I can delete the whole selection inserting #127. I can't do the same with WP6. For example:

procedure Test;
begin
with WPRichText1 do
begin
Text := 'This is the old text ';
SelectAll;
SelText := 'This is the new text';
end;
end;

This example finishes with "This is the old text This is the new text" in WP6, but it must be only "This is the new text". Similar problem if I do:

procedure Test;
begin
with WPRichText1 do
begin
Text := 'This is the old text ';
SelectAll;
InputString('This is the new text');
end;
end;

As the documentation of WP6 does not say to much about SelectAll and SelText, I can't find what is missed.

Any idea?

Felipe.

#1 ♥ 0
4.1k Views 2 users read 2 min

What about
wprt.SelectionAsString := 'blah';
or
wprt.ClearSelection;
wprt.SelectionAsString := 'blah';
?

best wishes,
Wolfgang

#2 ♥ 0

@leprince:
What about
wprt.SelectionAsString := 'blah';
or
wprt.ClearSelection;
wprt.SelectionAsString := 'blah';
?

best wishes,
Wolfgang

Hi Wolfgang;

Noup, I also tried both ideas but they don't do the trick. Is this a bug?. By the way, I am using a normal TWPRichText component with all the defauls; I only changed to wpPlayNormal.

Regards,

Felipe.

#3 ♥ 0
This category is archived. No new posts are possible.