It looks like the Visible property for each
KryptonRibbonQATButton control gets changed when they are toggled on and off by the user.
So you should be able to use the
PropertyChanged event for each button to track its state:
- Code: Select all
private void kryptonRibbonQATButton1_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
var button = (KryptonRibbonQATButton)sender;
if (e.PropertyName == "Visible")
{
if (button.Visible)
{
// do something
}
else
{
// do something else
}
}
}
Alternatively, you just preserve the state of the QAT buttons during
FormClosing and restore it later during
Load:
- Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
foreach (KryptonRibbonQATButton button in kryptonRibbon1.QATButtons)
{
button.Visible = /* determine state here */;
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
foreach (KryptonRibbonQATButton button in kryptonRibbon1.QATButtons)
{
/* save state here */
}
}