开发者

richtextbox, embedding custom object

开发者 https://www.devze.com 2023-02-15 15:27 出处:网络
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

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).

0

精彩评论

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