richtextbox, embedding custom object
I have a customized class which holds every move in chess and I want to write down every move to a richtextbox. So I am going to overload the tostring() of that custom class and use some formatting to add it to the rtf property of richtextbox. I need to find out which object is clicked so that I can set the game board accordingly. I don't know how to detect which object is clicked inside the richtextbox. Probabely I can use LinkClicked event of the richtextbox by introducing every object as a link开发者_StackOverflow社区 to richtextbox. Any ideas??
Not a direct answer of your question - but using a ListBox, ListView, or other list control is not only much simpler, but will do everything you are asking and more (it's what they were designed for).
精彩评论