问题
I need to draw some lines, and they have very significant meaning to the content that will be linked to them.
How do I draw/render a Line (that has been drawn using GDI+) as a Control?
What I mean by that is, how do I draw a line that has its own properties, etc. For example, if while drawing the line, I will need to assign information to it, making it unique to all the other lines:
public void deleteSeletedLineButton_Click(object sender, EventArgs e)
{
foreach(Line line in panel1.Lines)
{
if(line.Name == "lineNumber2")
{
line.Delete();
{
}
}
How an I set values to lines that I draw?:
myLine.SomeValue = "hooray!";
And, how can I make drawn lines/other shaped selectable (and movable/deletable/able to be enumerated)?
Are there better/easier ways to draw in C# than GDI?

来源:https://stackoverflow.com/questions/15278625/rendering-lines-as-selectable-controls-with-properties