[DllImport("user32.dll")]
static extern bool LockWindowUpdate(IntPtr hWndLock);
public Form1()
{
InitializeComponent();
for (int i = 0; i <this.ribbonControlAdv1.Header.MainItems.Count; i++)
{
(this.ribbonControlAdv1.Header.MainItems[i] asToolStripTabItem).Panel.VisibleChanged += Panel_VisibleChanged;
}
this.ribbonControlAdv1.SelectedTabItemChanged += RibbonControlAdv1_SelectedTabItemChanged;
}
private void Panel_VisibleChanged(object sender, EventArgs e)
{
LockWindowUpdate((sender as RibbonPanel).Handle);
}
private void RibbonControlAdv1_SelectedTabItemChanged(objectsender, SelectedTabChangedEventArgs e)
{
LockWindowUpdate(IntPtr.Zero);
} |
foreach(ToolStripTabItem tabItem inthis.ribbonControlAdv1.Header.MainItems)
{
tabItem.CheckedChanged += TabItem_CheckedChanged;
}
private void TabItem_CheckedChanged(object sender, EventArgs e)
{
//Suspend Code
} |