Hi Thomas,
In all my projetcs, I use only derived classes from SF classes (some are derived twice, one from SF, and onother from this first derivation for each kind of project).
Here's how I faced this MaintenanceToolStrip derivation proble: I need to add buttons for Print and Preview, each of them in a detail or full list version, in 2 new dropdown buttons. And I needed to choose these buttons to be dynamically visible or not, for each forms hosting this new maintenance toolstrip, depending of the condition of existing rows or not in the main BO.
So I wrote it inside the designer file itself, in the class definition
Friend WithEvents ToolStripSeparator As System.Windows.Forms.ToolStripSeparator
Friend WithEvents PRINT As System.Windows.Forms.ToolStripButton
Friend WithEvents PREVIEW As System.Windows.Forms.ToolStripButton
Friend WithEvents mnuPREVIEW As System.Windows.Forms.ToolStripDropDownButton
Friend WithEvents PREVIEWLISTE As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents PREVIEWDETAIL As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mnuPRINT As System.Windows.Forms.ToolStripDropDownButton
Friend WithEvents PRINTLISTE As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents PRINTDETAIL As System.Windows.Forms.ToolStripMenuItem
and in the InitializeComponent sub:
Private Sub InitializeComponent()
Me.ToolStripSeparator = New System.Windows.Forms.ToolStripSeparator
Me.PRINT = New System.Windows.Forms.ToolStripButton
Me.PREVIEW = New System.Windows.Forms.ToolStripButton
Me.mnuPRINT = New System.Windows.Forms.ToolStripDropDownButton
Me.PRINTLISTE = New System.Windows.Forms.ToolStripMenuItem
Me.PRINTDETAIL = New System.Windows.Forms.ToolStripMenuItem
Me.mnuPREVIEW = New System.Windows.Forms.ToolStripDropDownButton
Me.PREVIEWLISTE = New System.Windows.Forms.ToolStripMenuItem
Me.PREVIEWDETAIL = New System.Windows.Forms.ToolStripMenuItem
Me.SuspendLayout()
'
'ToolStripSeparator
'
Me.ToolStripSeparator.Name = "ToolStripSeparator"
Me.ToolStripSeparator.Size = New System.Drawing.Size(6, 25)
'
'Imprimer
'
Me.PRINT.Image = Global.MLControlesSF.My.Resources.Resources.Printer96
Me.PRINT.ImageTransparentColor = System.Drawing.Color.Magenta
Me.PRINT.Name = "PRINT"
'... and so on
this code works fine for many years, just forgot it.