开发者

Selecting Multiple Text Objects

Consider there are two text field objects:

TextField1="texta";
TextField2="textb";

Output:

texta textb

Now I want to select from "ta" in Tex开发者_如何转开发tField1 to "tex" in TextField2. By the drag of a mouse.

I know that by conventional methods it is not possible? Is there any other way to achieve this? And I need to highlight the text also. Please help me....


On mouse down in one test field add a mouse over handler for the other text field.

In that handler work out from the local x co-ordinates of the mouse and the FontMetrics of the text, how many characters should be highlighted.

You can then do setSelection(...) to highlight the correct characters.

There are much easier ways of doing this if you weren't using multiple TextFields...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜