4
public void flow_Resize(object sender, PaintEventArgs e)
           {
               FlowLayoutPanel flow = sender as FlowLayoutPanel;
               var item = listCtpMgr.FirstOrDefault(o => o.flp.Name == flow.Name);
               if (item == null)
                   return;
               addedCTP = (Microsoft.Office.Tools.CustomTaskPane)item.ctp;
               if (addedCTP == null)
                   return;
               ToolStrip _toolstrip = (ToolStrip)flow.Controls[0];
               int MaxButtonWidthforThisToolbar = 0;
               foreach (ToolStripItem toolStripItem in _toolstrip.Items)
               {
                   if ((toolStripItem.Width) > MaxButtonWidthforThisToolbar)
                   {
                       MaxButtonWidthforThisToolbar = (toolStripItem.Width);
                   }
               }
               MaxButtonWidthforThisToolbar += 10;
               if (addedCTP.DockPosition == MsoCTPDockPosition.msoCTPDockPositionLeft || addedCTP.DockPosition ==
   MsoCTPDockPosition.msoCTPDockPositionRight)
               {
                   if (addedCTP.Width < MaxButtonWidthforThisToolbar)
                       addedCTP.Width = MaxButtonWidthforThisToolbar;
               }
               else if (addedCTP.DockPosition == MsoCTPDockPosition.msoCTPDockPositionTop || addedCTP.DockPosition ==
   MsoCTPDockPosition.msoCTPDockPositionBottom)
               {
                   addedCTP.Height = 50;
               }
               else
               {
               addedCTP.Width = _toolstrip.Width + 27;
               addedCTP.Height = _toolstrip.Height + 57;
           }

       }

Above Custom Task Pane Code is Working Fine in Word 2010 but in Word 2013 it is Flickring..Please Help ....I Used Resize also and SizeChange Also...

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
Khatri
  • 61
  • 1
  • 3
  • Did you try setting .DoubleBuffered property ? https://msdn.microsoft.com/en-us/library/system.windows.forms.control.doublebuffered(v=vs.100).aspx – aybe Jul 27 '15 at 12:43
  • Thank you For Comment .can you Help me Where to use it? or Where to add or Replace the line? – Khatri Jul 27 '15 at 13:10
  • Set it to true to the control that is flickering I guess ? :D – aybe Jul 27 '15 at 13:21

0 Answers0