获取WinForm.StripItem对象的.net类型,然后参考下面代码反向判断一下
Select Case Type
Case StripItemTypeEnum.MenuItem
item = New ToolStripMenuItem
Exit Select
Case StripItemTypeEnum.Button
item = New ToolStripButton With { _
.DisplayStyle = ToolStripItemDisplayStyle.Image _
}
Exit Select
Case StripItemTypeEnum.Label
item = New ToolStripLabel
Exit Select
Case StripItemTypeEnum.SplitButton
item = New ToolStripSplitButton With { _
.DisplayStyle = ToolStripItemDisplayStyle.Image _
}
Exit Select
Case StripItemTypeEnum.TextBox
item = New ToolStripTextBox
Exit Select
Case StripItemTypeEnum.ComboBox
item = New ToolStripComboBox
Exit Select
Case StripItemTypeEnum.Separator
item = New ToolStripSeparator
Exit Select
End Select