开发者

What is the best way to handle a line custom control?

开发者 https://www.devze.com 2023-04-11 08:19 出处:网络
I am writing a Database Diagram tool (in VS 2010, C# 4.0) and I am having an issue. I have written the TableEntity custom controls and now I need to write the Relationship control. But I\'m not sure o

I am writing a Database Diagram tool (in VS 2010, C# 4.0) and I am having an issue. I have written the TableEntity custom controls and now I need to write the Relationship control. But I'm not sure of the best way to proceed. From what I know so far, I can only draw within the ClientRectangle of the current control. So if I were to write a Relationship control that joined two tables the control would have to either be large enough to include both endpoints or it would take multiple physical controls to represent one logical control.

If th开发者_如何学Ce control is big they will overlap in several places and I'll need an elaborate HitTest to determine what the user is clicking on (as well as a messaging system for passing the click to controls underneath this one for them to HitTest).

If I use multiple physical controls how do I represent them as a single logical control? Will reshaping them while a Table entity is moving be too slow?

Is there a "correct" way that I simply have not thought of yet?

Thanks in advance for the help.

0

精彩评论

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