开发者

Underlining 3 words at a time in WPF

In WPF, how would I do the following:

  1. Every x milliseconds, underline 3 words at a time. After x milliseconds, underline the next 3 words.

  2. Every x milliseconds, have 3 words appear and disappear from the window?

If I were to use Windows Forms, is there still a way of do开发者_JS百科ing (1) and (2) above?

Thank you


You will create a thread which will do (1) and (2). Take into account that actual interaction with UI should be done by means of Dispatcher i.e. window.Dispatcher.Invoke(...).

To host words you can use ItemsControl with custom ItemsPanelTemplate = WrapPanel.

To host text I suggest you to use TextBlock.

Underlining is done by means of TextBlock.TextDecorations property.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜