Answer the question
In order to leave comments, you need to log in
Why is InvalidCastException thrown?
You need to walk through TableLayoutPanel.ColumnStyles
.
I use the usual one foreach
:
foreach (ColumnStyle style in myTableLayout.ColumnStyles)
{
// произвожу свои действия
}
System.InvalidCastException
on line ColumnStyle style in myTableLayout.ColumnStyles
: Answer the question
In order to leave comments, you need to log in
I don't know what it was, but after deleting the project directory
and re-cloning from the VCS , the problem disappeared.
Thanks to all!
You have an erroneous type cast,
you are trying to cast the System.Windows.Forms.ColumnStyle type to System.Windows.Forms.RowStyle
, by mistake I won’t say anything more
like
MyClass != MySourceClass
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question