0
Unfortunately this method doesnt work as the compiler throws up an error... but I have found a way around it with re-designed structure. It is the assembly type line
0
This is a strange post. Your question asks "how to get the data out of a cotnrol and into the main program", but your code seems to be attempting something different. It almost seems to ask "how do I check for the type of an object?"
What kind of data is this? It should probably be exposed as a public property, but the data type will depend on what kind of data you are working with. When you say "Line", I think of an assembly line which may have any number of attributes (properties) that you're storing, or a graphics line, which has 4 integer cordinates and maybe a color.
Data that is internal to an object should be exposed through public functions or properties.
In order to check for the type of an object or one of its ancestor types, you can use the IS operator. Maybe something like this:
for (int i = 0; i < this.Controls.Count; i++) {
if (this.Controls[i] is Scheduler.Line) {
Scheduler.Line myLine = this.Controls[i];
break;
}
}