Hi @ShengChi Lo , Welcome to Microsoft Q&A. Updated: From a design point of view you cannot modify this [ReadOnly(true)] attribute like this. Is there an easy alternative you can live with? You can choose to disable disableCloseBtnName when enableTabClose is false。
private bool enableTabClose = true;
private bool disableCloseBtnName = true;
public bool EnableTabClose
{
get { return enableTabClose; }
set
{
if (enableTabClose != value)
{
enableTabClose = value;
Invalidate();
}
}
}
public bool DisableCloseBtnName
{
get { return disableCloseBtnName; }
set
{
if (enableTabClose)
{
if (disableCloseBtnName != value)
{
disableCloseBtnName = value;
Invalidate();
}
}
}
}
This is perfectly fine.
You can set two properties like this:
private bool enableTabClose = true;
private bool disableCloseBtnName = true;
public bool EnableTabClose
{
get { return enableTabClose; }
set
{
if (enableTabClose != value)
{
enableTabClose = value;
Invalidate();
DisableCloseBtnName = enableTabClose;
}
}
}
public bool DisableCloseBtnName
{
get { return disableCloseBtnName; }
set
{
if (disableCloseBtnName != value)
{
disableCloseBtnName = value;
Invalidate();
}
}
}
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.