I came across this syntax error – “Non-invocable member ‘System.Windows.Forms.Control.Controls’ cannot be used like a method” when converting a VB.NET project to C# windows form application.
In C#, weshould use bracket(“[", "]“) to retrieve item from a collection instead of using the parenthesis as in VB.NET.
VB.NET ->TabControl1.Controls(1).Enabled = False
C# -> this.TabControl1.Controls[1].Enabled = false;
Issue – “Operator ‘==’ cannot be applied to operands of type ‘method group’ and ‘System.Windows.Forms.DialogResult’”
if (SaveFileDialog1.ShowDialog == System.Windows.Forms.DialogResult.OK)
It is calling the ShowDIalog method not the value of the dialog
if (SaveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)