Controls not rendering

D

Dale Atkin

I had a bit of a minor 'crash' within the IDE this morning. Somehow it got
to thinking that something on my form was referencing itself as its own
parent. No idea how this happend.

Anyways, the only option given was to 'Ignore and Continue', with the
warning that controls might be lost. Not really a big deal, as I'd just
started on the form, so I didn't mind taking the risk.

Sure enough, once loaded, about half the controls on the form had
disappeared. I redrew the form, without too much trouble... or so I thought.

Several hours of code later, I realized that the controls which I *thought*
had disappeared, were in fact still in existance, they just had no visible
instantiation on the form, so no way to do anything with them in the IDE (I
can still reference them, and modify their properties etc. I just can't
delete them).

Anyone have a good way to delete these 'phantom' controls? I tried going
through and manually editing the .designer.vb file, removing all reference
to them, but I ended up with a totally *blank* form when I was done. All I
can think is I must have screwed up the syntax somewhere.

Following this message, I'll put the designer code, in case anyone sees an
obvious solution.

Dale
 
D

Dale Atkin

Might help if I didn't mis-click just before pasting the code...

The controls that are giving me trouble are TBSplit, lstFeatures, TextBox1
and PicMap

Dale

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmBrowse
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()
Me.TBSplit = New System.Windows.Forms.SplitContainer
Me.LRSplit = New System.Windows.Forms.SplitContainer
Me.picBrowser = New System.Windows.Forms.PictureBox
Me.lstFeat = New System.Windows.Forms.ListBox
Me.lblDesc = New System.Windows.Forms.LinkLabel
Me.TBSplit2 = New System.Windows.Forms.SplitContainer
Me.picMap = New System.Windows.Forms.PictureBox
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.lstFeatures = New System.Windows.Forms.ListBox
Me.TBSplit.Panel1.SuspendLayout()
Me.TBSplit.Panel2.SuspendLayout()
Me.TBSplit.SuspendLayout()
Me.LRSplit.Panel1.SuspendLayout()
Me.LRSplit.Panel2.SuspendLayout()
Me.LRSplit.SuspendLayout()
CType(Me.picBrowser,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.TBSplit2.Panel1.SuspendLayout()
Me.TBSplit2.Panel2.SuspendLayout()
Me.TBSplit2.SuspendLayout()
CType(Me.picMap,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'TBSplit
'
Me.TBSplit.Dock = System.Windows.Forms.DockStyle.Fill
Me.TBSplit.Location = New System.Drawing.Point(0, 0)
Me.TBSplit.Name = "TBSplit"
Me.TBSplit.Orientation = System.Windows.Forms.Orientation.Horizontal
'
'TBSplit.Panel1
'
Me.TBSplit.Panel1.Controls.Add(Me.LRSplit)
'
'TBSplit.Panel2
'
Me.TBSplit.Panel2.Controls.Add(Me.lblDesc)
Me.TBSplit.Size = New System.Drawing.Size(470, 441)
Me.TBSplit.SplitterDistance = 378
Me.TBSplit.TabIndex = 0
'
'LRSplit
'
Me.LRSplit.Dock = System.Windows.Forms.DockStyle.Fill
Me.LRSplit.Location = New System.Drawing.Point(0, 0)
Me.LRSplit.Name = "LRSplit"
'
'LRSplit.Panel1
'
Me.LRSplit.Panel1.Controls.Add(Me.picBrowser)
'
'LRSplit.Panel2
'
Me.LRSplit.Panel2.Controls.Add(Me.lstFeat)
Me.LRSplit.Size = New System.Drawing.Size(470, 378)
Me.LRSplit.SplitterDistance = 367
Me.LRSplit.TabIndex = 0
'
'picBrowser
'
Me.picBrowser.Anchor = System.Windows.Forms.AnchorStyles.None
Me.picBrowser.Location = New System.Drawing.Point(0, 0)
Me.picBrowser.Name = "picBrowser"
Me.picBrowser.Size = New System.Drawing.Size(352, 356)
Me.picBrowser.SizeMode =
System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picBrowser.TabIndex = 0
Me.picBrowser.TabStop = False
'
'lstFeat
'
Me.lstFeat.Dock = System.Windows.Forms.DockStyle.Fill
Me.lstFeat.FormattingEnabled = True
Me.lstFeat.Location = New System.Drawing.Point(0, 0)
Me.lstFeat.Name = "lstFeat"
Me.lstFeat.Size = New System.Drawing.Size(99, 368)
Me.lstFeat.TabIndex = 0
'
'lblDesc
'
Me.lblDesc.BackColor = System.Drawing.Color.White
Me.lblDesc.Dock = System.Windows.Forms.DockStyle.Fill
Me.lblDesc.Location = New System.Drawing.Point(0, 0)
Me.lblDesc.Name = "lblDesc"
Me.lblDesc.Size = New System.Drawing.Size(470, 59)
Me.lblDesc.TabIndex = 0
'
'TBSplit2
'
Me.TBSplit2.Dock = System.Windows.Forms.DockStyle.Fill
Me.TBSplit2.Location = New System.Drawing.Point(0, 0)
Me.TBSplit2.Name = "TBSplit2"
'
'TBSplit2.Panel1
'
Me.TBSplit2.Panel1.Controls.Add(Me.picMap)
'
'TBSplit2.Panel2
'
Me.TBSplit2.Panel2.Controls.Add(Me.TextBox1)
Me.TBSplit2.Panel2.Controls.Add(Me.lstFeatures)
Me.TBSplit2.Size = New System.Drawing.Size(470, 378)
Me.TBSplit2.SplitterDistance = 391
Me.TBSplit2.TabIndex = 0
'
'picMap
'
Me.picMap.Location = New System.Drawing.Point(80, 71)
Me.picMap.Name = "picMap"
Me.picMap.Size = New System.Drawing.Size(187, 216)
Me.picMap.TabIndex = 0
Me.picMap.TabStop = False
'
'TextBox1
'
Me.TextBox1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TextBox1.Location = New System.Drawing.Point(0, 0)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(75, 378)
Me.TextBox1.TabIndex = 0
'
'lstFeatures
'
Me.lstFeatures.Dock = System.Windows.Forms.DockStyle.Fill
Me.lstFeatures.FormattingEnabled = True
Me.lstFeatures.Location = New System.Drawing.Point(0, 0)
Me.lstFeatures.Name = "lstFeatures"
Me.lstFeatures.Size = New System.Drawing.Size(75, 368)
Me.lstFeatures.TabIndex = 0
'
'frmBrowse
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(470, 441)
Me.Controls.Add(Me.TBSplit)
Me.Name = "frmBrowse"
Me.Text = "Browse"
Me.TBSplit.Panel1.ResumeLayout(False)
Me.TBSplit.Panel2.ResumeLayout(False)
Me.TBSplit.ResumeLayout(False)
Me.LRSplit.Panel1.ResumeLayout(False)
Me.LRSplit.Panel2.ResumeLayout(False)
Me.LRSplit.ResumeLayout(False)
CType(Me.picBrowser,
System.ComponentModel.ISupportInitialize).EndInit()
Me.TBSplit2.Panel1.ResumeLayout(False)
Me.TBSplit2.Panel2.ResumeLayout(False)
Me.TBSplit2.Panel2.PerformLayout()
Me.TBSplit2.ResumeLayout(False)
CType(Me.picMap, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)

End Sub
Friend WithEvents TBSplit As System.Windows.Forms.SplitContainer
Friend WithEvents TBSplit2 As System.Windows.Forms.SplitContainer
Friend WithEvents picMap As System.Windows.Forms.PictureBox
Friend WithEvents lstFeatures As System.Windows.Forms.ListBox
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents LRSplit As System.Windows.Forms.SplitContainer
Friend WithEvents lstFeat As System.Windows.Forms.ListBox
Friend WithEvents picBrowser As System.Windows.Forms.PictureBox
Friend WithEvents lblDesc As System.Windows.Forms.LinkLabel
End Class
 
D

Dale Atkin

Might help if I didn't mis-click just before pasting the code...

The controls that are giving me trouble are TBSplit, lstFeatures, TextBox1
and PicMap

Dale

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmBrowse
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()
Me.TBSplit = New System.Windows.Forms.SplitContainer
Me.LRSplit = New System.Windows.Forms.SplitContainer
Me.picBrowser = New System.Windows.Forms.PictureBox
Me.lstFeat = New System.Windows.Forms.ListBox
Me.lblDesc = New System.Windows.Forms.LinkLabel
Me.TBSplit2 = New System.Windows.Forms.SplitContainer
Me.picMap = New System.Windows.Forms.PictureBox
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.lstFeatures = New System.Windows.Forms.ListBox
Me.TBSplit.Panel1.SuspendLayout()
Me.TBSplit.Panel2.SuspendLayout()
Me.TBSplit.SuspendLayout()
Me.LRSplit.Panel1.SuspendLayout()
Me.LRSplit.Panel2.SuspendLayout()
Me.LRSplit.SuspendLayout()
CType(Me.picBrowser,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.TBSplit2.Panel1.SuspendLayout()
Me.TBSplit2.Panel2.SuspendLayout()
Me.TBSplit2.SuspendLayout()
CType(Me.picMap,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'TBSplit
'
Me.TBSplit.Dock = System.Windows.Forms.DockStyle.Fill
Me.TBSplit.Location = New System.Drawing.Point(0, 0)
Me.TBSplit.Name = "TBSplit"
Me.TBSplit.Orientation = System.Windows.Forms.Orientation.Horizontal
'
'TBSplit.Panel1
'
Me.TBSplit.Panel1.Controls.Add(Me.LRSplit)
'
'TBSplit.Panel2
'
Me.TBSplit.Panel2.Controls.Add(Me.lblDesc)
Me.TBSplit.Size = New System.Drawing.Size(470, 441)
Me.TBSplit.SplitterDistance = 378
Me.TBSplit.TabIndex = 0
'
'LRSplit
'
Me.LRSplit.Dock = System.Windows.Forms.DockStyle.Fill
Me.LRSplit.Location = New System.Drawing.Point(0, 0)
Me.LRSplit.Name = "LRSplit"
'
'LRSplit.Panel1
'
Me.LRSplit.Panel1.Controls.Add(Me.picBrowser)
'
'LRSplit.Panel2
'
Me.LRSplit.Panel2.Controls.Add(Me.lstFeat)
Me.LRSplit.Size = New System.Drawing.Size(470, 378)
Me.LRSplit.SplitterDistance = 367
Me.LRSplit.TabIndex = 0
'
'picBrowser
'
Me.picBrowser.Anchor = System.Windows.Forms.AnchorStyles.None
Me.picBrowser.Location = New System.Drawing.Point(0, 0)
Me.picBrowser.Name = "picBrowser"
Me.picBrowser.Size = New System.Drawing.Size(352, 356)
Me.picBrowser.SizeMode =
System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picBrowser.TabIndex = 0
Me.picBrowser.TabStop = False
'
'lstFeat
'
Me.lstFeat.Dock = System.Windows.Forms.DockStyle.Fill
Me.lstFeat.FormattingEnabled = True
Me.lstFeat.Location = New System.Drawing.Point(0, 0)
Me.lstFeat.Name = "lstFeat"
Me.lstFeat.Size = New System.Drawing.Size(99, 368)
Me.lstFeat.TabIndex = 0
'
'lblDesc
'
Me.lblDesc.BackColor = System.Drawing.Color.White
Me.lblDesc.Dock = System.Windows.Forms.DockStyle.Fill
Me.lblDesc.Location = New System.Drawing.Point(0, 0)
Me.lblDesc.Name = "lblDesc"
Me.lblDesc.Size = New System.Drawing.Size(470, 59)
Me.lblDesc.TabIndex = 0
'
'TBSplit2
'
Me.TBSplit2.Dock = System.Windows.Forms.DockStyle.Fill
Me.TBSplit2.Location = New System.Drawing.Point(0, 0)
Me.TBSplit2.Name = "TBSplit2"
'
'TBSplit2.Panel1
'
Me.TBSplit2.Panel1.Controls.Add(Me.picMap)
'
'TBSplit2.Panel2
'
Me.TBSplit2.Panel2.Controls.Add(Me.TextBox1)
Me.TBSplit2.Panel2.Controls.Add(Me.lstFeatures)
Me.TBSplit2.Size = New System.Drawing.Size(470, 378)
Me.TBSplit2.SplitterDistance = 391
Me.TBSplit2.TabIndex = 0
'
'picMap
'
Me.picMap.Location = New System.Drawing.Point(80, 71)
Me.picMap.Name = "picMap"
Me.picMap.Size = New System.Drawing.Size(187, 216)
Me.picMap.TabIndex = 0
Me.picMap.TabStop = False
'
'TextBox1
'
Me.TextBox1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TextBox1.Location = New System.Drawing.Point(0, 0)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(75, 378)
Me.TextBox1.TabIndex = 0
'
'lstFeatures
'
Me.lstFeatures.Dock = System.Windows.Forms.DockStyle.Fill
Me.lstFeatures.FormattingEnabled = True
Me.lstFeatures.Location = New System.Drawing.Point(0, 0)
Me.lstFeatures.Name = "lstFeatures"
Me.lstFeatures.Size = New System.Drawing.Size(75, 368)
Me.lstFeatures.TabIndex = 0
'
'frmBrowse
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(470, 441)
Me.Controls.Add(Me.TBSplit)
Me.Name = "frmBrowse"
Me.Text = "Browse"
Me.TBSplit.Panel1.ResumeLayout(False)
Me.TBSplit.Panel2.ResumeLayout(False)
Me.TBSplit.ResumeLayout(False)
Me.LRSplit.Panel1.ResumeLayout(False)
Me.LRSplit.Panel2.ResumeLayout(False)
Me.LRSplit.ResumeLayout(False)
CType(Me.picBrowser,
System.ComponentModel.ISupportInitialize).EndInit()
Me.TBSplit2.Panel1.ResumeLayout(False)
Me.TBSplit2.Panel2.ResumeLayout(False)
Me.TBSplit2.Panel2.PerformLayout()
Me.TBSplit2.ResumeLayout(False)
CType(Me.picMap, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)

End Sub
Friend WithEvents TBSplit As System.Windows.Forms.SplitContainer
Friend WithEvents TBSplit2 As System.Windows.Forms.SplitContainer
Friend WithEvents picMap As System.Windows.Forms.PictureBox
Friend WithEvents lstFeatures As System.Windows.Forms.ListBox
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents LRSplit As System.Windows.Forms.SplitContainer
Friend WithEvents lstFeat As System.Windows.Forms.ListBox
Friend WithEvents picBrowser As System.Windows.Forms.PictureBox
Friend WithEvents lblDesc As System.Windows.Forms.LinkLabel
End Class
 
C

Cor Ligthert[MVP]

Dale,

This is the designer generated part, your behaviour happens often as you
change things in that.

As you very well know what the designer does, that is no problem, however
for others, the answer is simple.
Do it again.

Cor
 
C

Cor Ligthert[MVP]

Dale,

This is the designer generated part, your behaviour happens often as you
change things in that.

As you very well know what the designer does, that is no problem, however
for others, the answer is simple.
Do it again.

Cor
 
D

Dale Atkin

Cor Ligthert said:
Dale,

This is the designer generated part, your behaviour happens often as you
change things in that.

As you very well know what the designer does, that is no problem, however
for others, the answer is simple.
Do it again.

Cor

Hey,

Actually, the behavior I saw was the reason I started digging in the
designer code, not vice versa. I'm going to take another crack at editing
this code and see what I can come up with. I think I must have just deleted
a line I shouldn't have somewhere (trying to make too many changes at once).

Dale
 
D

Dale Atkin

Cor Ligthert said:
Dale,

This is the designer generated part, your behaviour happens often as you
change things in that.

As you very well know what the designer does, that is no problem, however
for others, the answer is simple.
Do it again.

Cor

Hey,

Actually, the behavior I saw was the reason I started digging in the
designer code, not vice versa. I'm going to take another crack at editing
this code and see what I can come up with. I think I must have just deleted
a line I shouldn't have somewhere (trying to make too many changes at once).

Dale
 
D

Dale Atkin

Hey,

Actually, the behavior I saw was the reason I started digging in the
designer code, not vice versa. I'm going to take another crack at editing
this code and see what I can come up with. I think I must have just
deleted a line I shouldn't have somewhere (trying to make too many changes
at once).

Dale

Is it wrong for me to take perverse pleasure in ignoring the warning :)

'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.

I've managed to successfully delete most of the offending controls. TBSplit
is still giving me some grief for some reason (every time I delete it,
nothing shows up on my form! I'll have to take a closer look at the code to
see if I can figure out why this is).

In case anyone is curious, basically what I did, was comment out the
declaration for the control at the begining of the designer code. Then when
I tried to bring up the form, the IDE conveniently gave me an error about
each and every one of the lines of code that contained a reference to that
control. I then went ahead and commented out each of these, and presto. No
more pesky phantom controls.

Dale
 
D

Dale Atkin

Hey,

Actually, the behavior I saw was the reason I started digging in the
designer code, not vice versa. I'm going to take another crack at editing
this code and see what I can come up with. I think I must have just
deleted a line I shouldn't have somewhere (trying to make too many changes
at once).

Dale

Is it wrong for me to take perverse pleasure in ignoring the warning :)

'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.

I've managed to successfully delete most of the offending controls. TBSplit
is still giving me some grief for some reason (every time I delete it,
nothing shows up on my form! I'll have to take a closer look at the code to
see if I can figure out why this is).

In case anyone is curious, basically what I did, was comment out the
declaration for the control at the begining of the designer code. Then when
I tried to bring up the form, the IDE conveniently gave me an error about
each and every one of the lines of code that contained a reference to that
control. I then went ahead and commented out each of these, and presto. No
more pesky phantom controls.

Dale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top