Skip to content

Commit bd2f32b

Browse files
Null checked the ToolPanel item.
1 parent 1830975 commit bd2f32b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Form1.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ public Form1()
3535
InitializeComponent();
3636
foreach (ToolStripTabItem items in this.ribbonControlAdv1.Header.MainItems)
3737
{
38-
foreach (ToolStripEx item in items.Panel.Controls)
38+
foreach (var item in items.Panel.Controls)
3939
{
40-
item.LauncherClick += new EventHandler(item_LauncherClick);
40+
ToolStripEx toolStripEx = item as ToolStripEx;
41+
if(toolStripEx != null)
42+
toolStripEx.LauncherClick += new EventHandler(item_LauncherClick);
4143
}
4244
}
4345
PopulateColorTable();

0 commit comments

Comments
 (0)