I am having a small issue where the defined custom property value is not sticking in the inherited form.
The code in my base form is:
namespace ContractManagement.Forms
{
public partial class BaseForm : Form
{
public BaseForm()
{
InitializeComponent();
}
public Boolean DialogForm
{
get
{
return TitleLabel.Visible;
}
set
{
TitleLabel.Visible = value;
CommandPanel.Visible = value;
}
}
protected override void OnTextChanged(EventArgs e)
{
base.OnTextChanged(e);
TitleLabel.Text = Text;
}
}
}
Then in the form that inherits this I have:
namespace ContractManagement.Forms
{
public partial class MainForm : Forms.BaseForm
{
public MainForm()
{
InitializeComponent();
}
}
}
For some reason, despite what I set in MainForm for DialogForm, on runtime it reverts back to True.
There is another post on this site which mentions this, but I don’t get what it explains.
I also want to create a property which allows me to hide the ControlBox, so how do I add this in?
I believe I have done it now: