I had long time developing windows applications using VB.NET and one of thing that I was always use is:
Class (Test) and inside it there are some subs like the following:
VB.NET Code.
Expand|Select|Wrap|Line Numbers
- Friend Sub FLoadKeyLock(ByVal FRMNAME As Object)
- FRMNAME.Button1.Enabled = True
- FRMNAME.Button2.Enabled = True
- FRMNAME.Button3.Enabled = False
- FRMNAME.Button4.Enabled = False
- FRMNAME.Button5.Enabled = True
- FRMNAME.Button6.Enabled = True
- FRMNAME.Button7.Enabled = True
- End Sub
that was totally works fine in VB.NET but I cannot use it the same way in C#.NET.
C#.NET Code
Expand|Select|Wrap|Line Numbers
- internal void FLoadKeyLock (Form FRMNAME)
- {
- FRMNAME.Button3.Enabled = true;
- FRMNAME.Button4.Enabled = true;
- FRMNAME.Button1.Enabled = false;
- FRMNAME.Button2.Enabled = false;
- FRMNAME.Button5.Enabled = false;
- FRMNAME.Button6.Enabled = false;
- FRMNAME.Button7.Enabled = false;
- FRMNAME.Button8.Enabled = false;
- FRMNAME.Button9.Enabled = false;
- FRMNAME.Button10.Enabled = false;
- }
And same error for all used buttons.
So I have two questions:
1 - How to use such a function in C#.NET?
2 - Why it's not working the same way as VB.NET?
Thanks.