Underlining 3 words at a time in WPF
In WPF, how would I do the following:
Every x milliseconds, underline 3 words at a time. After x milliseconds, underline the next 3 words.
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.
精彩评论