Results 1 to 5 of 5

Thread: VS2010 statusstrip problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    99

    VS2010 statusstrip problem

    I have a status strip that is resisting all my efforts to reset to 'Visible'.

    When I open the form with the status strip in designer mode, the status strip is not displayed but does appear with other embedded tools (i.e. toolstrip) at the bottom of the screen. I click the bottom display and the strip then appears on the form proper. In the status strip properties I scroll down to Visible, which is set to False (bold face). I change this to True (displays in normal font). If I save, close and reopen the form, the status strip is again set to Visible = False, displayed in bold face. This seems to happen on the 'save' because the visible property also seems to be reset when I compile or compile/run the app.

    Every time I reload the form.vb file, the Visible property is reset to False (in bold font), regardless of the state in which it was saved.

    Note that setting the visible attribute at run time is also an epic fail.

    Here's the status strip property definition from the designer file:

    HTML Code:
            '
            'SpecStatusStrip
            '
            Me.SpecStatusStrip.Dock = System.Windows.Forms.DockStyle.None
            Me.SpecStatusStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SpecStatusLabel, Me.SpecStatsDropDownButton})
            Me.SpecStatusStrip.Location = New System.Drawing.Point(0, 0)
            Me.SpecStatusStrip.Name = "SpecStatusStrip"
            Me.SpecStatusStrip.Size = New System.Drawing.Size(930, 25)
            Me.SpecStatusStrip.TabIndex = 1

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: VS2010 statusstrip problem

    Are you able to post your entire Form.Designer.vb file? Or a reduced version that replicates the problem for you?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    99

    Re: VS2010 statusstrip problem

    For reasons of length I left out the 'Friend...' statements at the end.

    Code:
    <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
    Partial Class SpectrometerDisplayForm
        Inherits System.Windows.Forms.Form
    
        'Form overrides dispose to clean up the component list.
        <System.Diagnostics.DebuggerNonUserCode()> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try
                If disposing AndAlso components IsNot Nothing Then
                    components.Dispose()
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub
    
        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer
    
        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> _
        Private Sub InitializeComponent()
            Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(SpectrometerDisplayForm))
            Me.MonitorDisplayGraph = New ZedGraph.ZedGraphControl()
            Me.SpecStatusStrip = New System.Windows.Forms.StatusStrip()
            Me.SpecStatsDropDownButton = New System.Windows.Forms.ToolStripDropDownButton()
            Me.WvLength4ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.WvLength3ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.WvLength2ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.WvLength1ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
            Me.ToolStripContainer1 = New System.Windows.Forms.ToolStripContainer()
            Me.Label1 = New System.Windows.Forms.Label()
            Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
            Me.PrintSingleScanStripButton = New System.Windows.Forms.ToolStripButton()
            Me.ExportSingleScanToolStripButton = New System.Windows.Forms.ToolStripButton()
            Me.CalculatePeaks = New System.Windows.Forms.ToolStripButton()
            Me.SpecStatus = New System.Windows.Forms.StatusStrip()
            Me.SpecStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel()
            Me.SpecStatsDropDownButton1 = New System.Windows.Forms.ToolStripDropDownButton()
            Me.WvLength1ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
            Me.WvLength2ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
            Me.WvLength3ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
            Me.WvLength4ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
            Me.SpecStatusStrip.SuspendLayout()
            Me.ToolStripContainer1.ContentPanel.SuspendLayout()
            Me.ToolStripContainer1.TopToolStripPanel.SuspendLayout()
            Me.ToolStripContainer1.SuspendLayout()
            Me.ToolStrip1.SuspendLayout()
            Me.SpecStatus.SuspendLayout()
            Me.SuspendLayout()
            '
            'MonitorDisplayGraph
            '
            Me.MonitorDisplayGraph.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                        Or System.Windows.Forms.AnchorStyles.Left) _
                        Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
            Me.MonitorDisplayGraph.Location = New System.Drawing.Point(28, 28)
            Me.MonitorDisplayGraph.Margin = New System.Windows.Forms.Padding(5)
            Me.MonitorDisplayGraph.Name = "MonitorDisplayGraph"
            Me.MonitorDisplayGraph.ScrollGrace = 0.0R
            Me.MonitorDisplayGraph.ScrollMaxX = 0.0R
            Me.MonitorDisplayGraph.ScrollMaxY = 0.0R
            Me.MonitorDisplayGraph.ScrollMaxY2 = 0.0R
            Me.MonitorDisplayGraph.ScrollMinX = 0.0R
            Me.MonitorDisplayGraph.ScrollMinY = 0.0R
            Me.MonitorDisplayGraph.ScrollMinY2 = 0.0R
            Me.MonitorDisplayGraph.Size = New System.Drawing.Size(869, 276)
            Me.MonitorDisplayGraph.TabIndex = 0
            '
            'SpecStatusStrip
            '
            Me.SpecStatusStrip.Dock = System.Windows.Forms.DockStyle.None
            Me.SpecStatusStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SpecStatsDropDownButton})
            Me.SpecStatusStrip.Location = New System.Drawing.Point(0, 325)
            Me.SpecStatusStrip.Name = "SpecStatusStrip"
            Me.SpecStatusStrip.Size = New System.Drawing.Size(61, 22)
            Me.SpecStatusStrip.TabIndex = 1
            '
            'SpecStatsDropDownButton
            '
            Me.SpecStatsDropDownButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
            Me.SpecStatsDropDownButton.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.WvLength4ToolStripMenuItem, Me.WvLength3ToolStripMenuItem, Me.WvLength2ToolStripMenuItem, Me.WvLength1ToolStripMenuItem})
            Me.SpecStatsDropDownButton.Enabled = False
            Me.SpecStatsDropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.SpecStatsDropDownButton.Name = "SpecStatsDropDownButton"
            Me.SpecStatsDropDownButton.Size = New System.Drawing.Size(13, 20)
            '
            'WvLength4ToolStripMenuItem
            '
            Me.WvLength4ToolStripMenuItem.Name = "WvLength4ToolStripMenuItem"
            Me.WvLength4ToolStripMenuItem.Size = New System.Drawing.Size(156, 24)
            Me.WvLength4ToolStripMenuItem.Text = "WvLength 4"
            '
            'WvLength3ToolStripMenuItem
            '
            Me.WvLength3ToolStripMenuItem.Name = "WvLength3ToolStripMenuItem"
            Me.WvLength3ToolStripMenuItem.Size = New System.Drawing.Size(156, 24)
            Me.WvLength3ToolStripMenuItem.Text = "WvLength3"
            '
            'WvLength2ToolStripMenuItem
            '
            Me.WvLength2ToolStripMenuItem.Name = "WvLength2ToolStripMenuItem"
            Me.WvLength2ToolStripMenuItem.Size = New System.Drawing.Size(156, 24)
            Me.WvLength2ToolStripMenuItem.Text = "WvLength2"
            '
            'WvLength1ToolStripMenuItem
            '
            Me.WvLength1ToolStripMenuItem.Name = "WvLength1ToolStripMenuItem"
            Me.WvLength1ToolStripMenuItem.Size = New System.Drawing.Size(156, 24)
            Me.WvLength1ToolStripMenuItem.Text = "WvLength1"
            '
            'ToolStripContainer1
            '
            Me.ToolStripContainer1.BottomToolStripPanelVisible = False
            '
            'ToolStripContainer1.ContentPanel
            '
            Me.ToolStripContainer1.ContentPanel.AutoScroll = True
            Me.ToolStripContainer1.ContentPanel.Controls.Add(Me.SpecStatusStrip)
            Me.ToolStripContainer1.ContentPanel.Controls.Add(Me.Label1)
            Me.ToolStripContainer1.ContentPanel.Controls.Add(Me.MonitorDisplayGraph)
            Me.ToolStripContainer1.ContentPanel.Size = New System.Drawing.Size(930, 375)
            Me.ToolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.ToolStripContainer1.LeftToolStripPanelVisible = False
            Me.ToolStripContainer1.Location = New System.Drawing.Point(0, 0)
            Me.ToolStripContainer1.Name = "ToolStripContainer1"
            Me.ToolStripContainer1.RightToolStripPanelVisible = False
            Me.ToolStripContainer1.Size = New System.Drawing.Size(930, 400)
            Me.ToolStripContainer1.TabIndex = 2
            Me.ToolStripContainer1.Text = "ToolStripContainer1"
            '
            'ToolStripContainer1.TopToolStripPanel
            '
            Me.ToolStripContainer1.TopToolStripPanel.Controls.Add(Me.ToolStrip1)
            '
            'Label1
            '
            Me.Label1.AutoSize = True
            Me.Label1.Location = New System.Drawing.Point(651, 6)
            Me.Label1.Name = "Label1"
            Me.Label1.Size = New System.Drawing.Size(51, 17)
            Me.Label1.TabIndex = 1
            Me.Label1.Text = "Label1"
            '
            'ToolStrip1
            '
            Me.ToolStrip1.Dock = System.Windows.Forms.DockStyle.None
            Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.PrintSingleScanStripButton, Me.ExportSingleScanToolStripButton, Me.CalculatePeaks})
            Me.ToolStrip1.Location = New System.Drawing.Point(3, 0)
            Me.ToolStrip1.Name = "ToolStrip1"
            Me.ToolStrip1.Size = New System.Drawing.Size(58, 25)
            Me.ToolStrip1.TabIndex = 0
            '
            'PrintSingleScanStripButton
            '
            Me.PrintSingleScanStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
            Me.PrintSingleScanStripButton.Image = CType(resources.GetObject("PrintSingleScanStripButton.Image"), System.Drawing.Image)
            Me.PrintSingleScanStripButton.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.PrintSingleScanStripButton.Name = "PrintSingleScanStripButton"
            Me.PrintSingleScanStripButton.Size = New System.Drawing.Size(23, 22)
            Me.PrintSingleScanStripButton.Text = "Print Single Scan Report"
            '
            'ExportSingleScanToolStripButton
            '
            Me.ExportSingleScanToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
            Me.ExportSingleScanToolStripButton.Image = CType(resources.GetObject("ExportSingleScanToolStripButton.Image"), System.Drawing.Image)
            Me.ExportSingleScanToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.ExportSingleScanToolStripButton.Name = "ExportSingleScanToolStripButton"
            Me.ExportSingleScanToolStripButton.Size = New System.Drawing.Size(23, 22)
            Me.ExportSingleScanToolStripButton.Text = "Export"
            '
            'CalculatePeaks
            '
            Me.CalculatePeaks.BackgroundImage = Global.NVSpecMon.My.Resources.Resources.graph
            Me.CalculatePeaks.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
            Me.CalculatePeaks.Image = Global.NVSpecMon.My.Resources.Resources.graph
            Me.CalculatePeaks.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.CalculatePeaks.Name = "CalculatePeaks"
            Me.CalculatePeaks.Size = New System.Drawing.Size(23, 22)
            Me.CalculatePeaks.Text = "Calculate Peaks"
            Me.CalculatePeaks.Visible = False
            '
            'SpecStatus
            '
            Me.SpecStatus.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SpecStatusLabel1, Me.SpecStatsDropDownButton1})
            Me.SpecStatus.Location = New System.Drawing.Point(0, 375)
            Me.SpecStatus.Name = "SpecStatus"
            Me.SpecStatus.Size = New System.Drawing.Size(930, 25)
            Me.SpecStatus.TabIndex = 3
            Me.SpecStatus.Text = "StatusStrip1"
            '
            'SpecStatusLabel1
            '
            Me.SpecStatusLabel1.Enabled = False
            Me.SpecStatusLabel1.Name = "SpecStatusLabel1"
            Me.SpecStatusLabel1.Size = New System.Drawing.Size(247, 20)
            Me.SpecStatusLabel1.Text = "No individiual wavelengths selected"
            '
            'SpecStatsDropDownButton1
            '
            Me.SpecStatsDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
            Me.SpecStatsDropDownButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.WvLength4ToolStripMenuItem1, Me.WvLength3ToolStripMenuItem1, Me.WvLength2ToolStripMenuItem1, Me.WvLength1ToolStripMenuItem1})
            Me.SpecStatsDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta
            Me.SpecStatsDropDownButton1.Name = "SpecStatsDropDownButton1"
            Me.SpecStatsDropDownButton1.Size = New System.Drawing.Size(13, 23)
            Me.SpecStatsDropDownButton1.Text = "ToolStripDropDownButton1"
            '
            'WvLength1ToolStripMenuItem1
            '
            Me.WvLength1ToolStripMenuItem1.Name = "WvLength1ToolStripMenuItem1"
            Me.WvLength1ToolStripMenuItem1.Size = New System.Drawing.Size(152, 24)
            Me.WvLength1ToolStripMenuItem1.Text = "WvLength1"
            '
            'WvLength2ToolStripMenuItem1
            '
            Me.WvLength2ToolStripMenuItem1.Name = "WvLength2ToolStripMenuItem1"
            Me.WvLength2ToolStripMenuItem1.Size = New System.Drawing.Size(152, 24)
            Me.WvLength2ToolStripMenuItem1.Text = "WvLength2"
            '
            'WvLength3ToolStripMenuItem1
            '
            Me.WvLength3ToolStripMenuItem1.Name = "WvLength3ToolStripMenuItem1"
            Me.WvLength3ToolStripMenuItem1.Size = New System.Drawing.Size(152, 24)
            Me.WvLength3ToolStripMenuItem1.Text = "WvLength3"
            '
            'WvLength4ToolStripMenuItem1
            '
            Me.WvLength4ToolStripMenuItem1.Name = "WvLength4ToolStripMenuItem1"
            Me.WvLength4ToolStripMenuItem1.Size = New System.Drawing.Size(152, 24)
            Me.WvLength4ToolStripMenuItem1.Text = "WvLength4"
            '
            'SpectrometerDisplayForm
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(930, 400)
            Me.Controls.Add(Me.SpecStatus)
            Me.Controls.Add(Me.ToolStripContainer1)
            Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
            Me.Margin = New System.Windows.Forms.Padding(4)
            Me.MaximizeBox = False
            Me.Name = "SpectrometerDisplayForm"
            Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
            Me.Text = "Monitor: "
            Me.SpecStatusStrip.ResumeLayout(False)
            Me.SpecStatusStrip.PerformLayout()
            Me.ToolStripContainer1.ContentPanel.ResumeLayout(False)
            Me.ToolStripContainer1.ContentPanel.PerformLayout()
            Me.ToolStripContainer1.TopToolStripPanel.ResumeLayout(False)
            Me.ToolStripContainer1.TopToolStripPanel.PerformLayout()
            Me.ToolStripContainer1.ResumeLayout(False)
            Me.ToolStripContainer1.PerformLayout()
            Me.ToolStrip1.ResumeLayout(False)
            Me.ToolStrip1.PerformLayout()
            Me.SpecStatus.ResumeLayout(False)
            Me.SpecStatus.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()
    
        End Sub
    
    End Class

  4. #4
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: VS2010 statusstrip problem

    Need the friend statements, I basically want to recreate your form on my screen and try to duplicate the behaviour.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    99

    Re: VS2010 statusstrip problem

    Code:
    Friend WithEvents MonitorDisplayGraph As ZedGraph.ZedGraphControl
        Friend WithEvents SpecStatusStrip As System.Windows.Forms.StatusStrip
        Friend WithEvents SpecStatsDropDownButton As System.Windows.Forms.ToolStripDropDownButton
        Friend WithEvents WvLength4ToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
        Friend WithEvents WvLength3ToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
        Friend WithEvents WvLength2ToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
        Friend WithEvents WvLength1ToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
        Friend WithEvents ToolStripContainer1 As System.Windows.Forms.ToolStripContainer
        Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
        Friend WithEvents PrintSingleScanStripButton As System.Windows.Forms.ToolStripButton
        Friend WithEvents ExportSingleScanToolStripButton As System.Windows.Forms.ToolStripButton
        Friend WithEvents CalculatePeaks As System.Windows.Forms.ToolStripButton
        Friend WithEvents Label1 As System.Windows.Forms.Label
        Friend WithEvents SpecStatus As System.Windows.Forms.StatusStrip
        Friend WithEvents SpecStatusLabel1 As System.Windows.Forms.ToolStripStatusLabel
        Friend WithEvents SpecStatsDropDownButton1 As System.Windows.Forms.ToolStripDropDownButton
        Friend WithEvents WvLength4ToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
        Friend WithEvents WvLength3ToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
        Friend WithEvents WvLength2ToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
        Friend WithEvents WvLength1ToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width