Hello,
I am new to C# (coming from Delphi) and find my main.cs file becoming quite large. In Delphi I can create classes in a .pas file and use it from my main application file. I simply add the uses (filename) keyword.
My question is how do I do something similar in C#? Example:
Delphi:
Button1.Visible = False;
I can refer to the buttons properties in another unit by adding a reference to the main unit:
frmMain.Button.Visible = True;
In C# I would like to move this code to another .cs file and call it from my main form. It does not work.
private void manageMainMenuButtons()
{
if (rtbSharedSARP.Text == "")
{
utmToolBar.Tools["First"].SharedProps.Enabled = false;
utmToolBar.Tools["Previous"].SharedProps.Enabled = false;
utmToolBar.Tools["Next"].SharedProps.Enabled = false;
utmToolBar.Tools["Last"].SharedProps.Enabled = false;
}
else
{
utmToolBar.Tools["First"].SharedProps.Enabled = true;
utmToolBar.Tools["Previous"].SharedProps.Enabled = true;
utmToolBar.Tools["Next"].SharedProps.Enabled = true;
utmToolBar.Tools["Last"].SharedProps.Enabled = true;
}
}
Not the best example, but I hope someone can help me.