[...]
As you can see, there is no code
The Designer generates code on your behalf. You haven't posted any of
that code. Nor have you posted the full context in which that code is
used.
Which is in a separate file which is automatically hidden by Visual Studio.
You'll have to expand the file list for your control_whatever.vb to find the
.Designer.vb file
Can you simplify it to just one or two images? Like perhaps the minimize
and maximize buttons aren't essential if the behavior still happens with the
close X.
Answering your question without that information is impossible.
It's possible that no one will be able to answer your question even with
that information. But without it, failure is practically guaranteed.
- Show quoted text -
Well, the same thing is happening with every control - the anchoring
doesnt seem to be applying for any control I make - I can resize the
control in the designer and its looks fine but as soon as I go into
runtime and there is a button or somthing in the containing control it
seems to loose its anchoring settings.
I belive the code pasted under nearth this text is what you are
looking for.
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Vista_Basic_Window
Inherits System.Windows.Forms.UserControl
'UserControl 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.img_Border_Left_Top_Corner = New
System.Windows.Forms.PictureBox
Me.img_Border_Right_Top_Corner = New
System.Windows.Forms.PictureBox
Me.img_Border_Minimize = New System.Windows.Forms.PictureBox
Me.img_Border_Maximize = New System.Windows.Forms.PictureBox
Me.img_Border_Close = New System.Windows.Forms.PictureBox
Me.img_Border_Titlebar = New System.Windows.Forms.PictureBox
Me.img_Border_Left_Top = New System.Windows.Forms.PictureBox
Me.img_Border_Left_Bottom = New
System.Windows.Forms.PictureBox
Me.img_Border_Right_Corner = New
System.Windows.Forms.PictureBox
Me.img_Border_Right_Top = New System.Windows.Forms.PictureBox
CType(Me.img_Border_Left_Top_Corner,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Right_Top_Corner,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Minimize,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Maximize,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Close,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Titlebar,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Left_Top,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Left_Bottom,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Right_Corner,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.img_Border_Right_Top,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'img_Border_Left_Top_Corner
'
Me.img_Border_Left_Top_Corner.BackgroundImage =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Left_Top
Me.img_Border_Left_Top_Corner.Location = New
System.Drawing.Point(0, 0)
Me.img_Border_Left_Top_Corner.Name =
"img_Border_Left_Top_Corner"
Me.img_Border_Left_Top_Corner.Size = New
System.Drawing.Size(8, 28)
Me.img_Border_Left_Top_Corner.SizeMode =
System.Windows.Forms.PictureBoxSizeMode.AutoSize
Me.img_Border_Left_Top_Corner.TabIndex = 20
Me.img_Border_Left_Top_Corner.TabStop = False
'
'img_Border_Right_Top_Corner
'
Me.img_Border_Right_Top_Corner.Anchor =
CType((System.Windows.Forms.AnchorStyles.Top Or
System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Right_Top_Corner.BackgroundImage =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Right_Top
Me.img_Border_Right_Top_Corner.Location = New
System.Drawing.Point(514, 0)
Me.img_Border_Right_Top_Corner.Name =
"img_Border_Right_Top_Corner"
Me.img_Border_Right_Top_Corner.Size = New
System.Drawing.Size(8, 28)
Me.img_Border_Right_Top_Corner.SizeMode =
System.Windows.Forms.PictureBoxSizeMode.AutoSize
Me.img_Border_Right_Top_Corner.TabIndex = 19
Me.img_Border_Right_Top_Corner.TabStop = False
'
'img_Border_Minimize
'
Me.img_Border_Minimize.Anchor =
CType((System.Windows.Forms.AnchorStyles.Top Or
System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Minimize.Image =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Minimize_Mouse_Off
Me.img_Border_Minimize.Location = New
System.Drawing.Point(423, 9)
Me.img_Border_Minimize.Name = "img_Border_Minimize"
Me.img_Border_Minimize.Size = New System.Drawing.Size(28, 15)
Me.img_Border_Minimize.SizeMode =
System.Windows.Forms.PictureBoxSizeMode.AutoSize
Me.img_Border_Minimize.TabIndex = 18
Me.img_Border_Minimize.TabStop = False
'
'img_Border_Maximize
'
Me.img_Border_Maximize.Anchor =
CType((System.Windows.Forms.AnchorStyles.Top Or
System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Maximize.Image =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Maximize_Mouse_Off
Me.img_Border_Maximize.Location = New
System.Drawing.Point(453, 9)
Me.img_Border_Maximize.Name = "img_Border_Maximize"
Me.img_Border_Maximize.Size = New System.Drawing.Size(28, 15)
Me.img_Border_Maximize.SizeMode =
System.Windows.Forms.PictureBoxSizeMode.AutoSize
Me.img_Border_Maximize.TabIndex = 17
Me.img_Border_Maximize.TabStop = False
'
'img_Border_Close
'
Me.img_Border_Close.Anchor =
CType((System.Windows.Forms.AnchorStyles.Top Or
System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Close.Image =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Close_Mouse_Off
Me.img_Border_Close.Location = New System.Drawing.Point(483,
9)
Me.img_Border_Close.Name = "img_Border_Close"
Me.img_Border_Close.Size = New System.Drawing.Size(28, 15)
Me.img_Border_Close.SizeMode =
System.Windows.Forms.PictureBoxSizeMode.AutoSize
Me.img_Border_Close.TabIndex = 16
Me.img_Border_Close.TabStop = False
'
'img_Border_Titlebar
'
Me.img_Border_Titlebar.Anchor =
CType(((System.Windows.Forms.AnchorStyles.Top Or
System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Titlebar.BackgroundImage =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Top_Tile
Me.img_Border_Titlebar.Location = New System.Drawing.Point(8,
0)
Me.img_Border_Titlebar.Name = "img_Border_Titlebar"
Me.img_Border_Titlebar.Size = New System.Drawing.Size(506, 28)
Me.img_Border_Titlebar.TabIndex = 15
Me.img_Border_Titlebar.TabStop = False
'
'img_Border_Left_Top
'
Me.img_Border_Left_Top.Anchor =
CType(((System.Windows.Forms.AnchorStyles.Top Or
System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Left_Top.BackgroundImage =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Left_Side_Tile
Me.img_Border_Left_Top.Image =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Left_Side_Top
Me.img_Border_Left_Top.Location = New System.Drawing.Point(0,
27)
Me.img_Border_Left_Top.Name = "img_Border_Left_Top"
Me.img_Border_Left_Top.Size = New System.Drawing.Size(8, 287)
Me.img_Border_Left_Top.TabIndex = 14
Me.img_Border_Left_Top.TabStop = False
'
'img_Border_Left_Bottom
'
Me.img_Border_Left_Bottom.Anchor =
CType(((System.Windows.Forms.AnchorStyles.Bottom Or
System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Left_Bottom.BackgroundImage =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Bottom_Tile
Me.img_Border_Left_Bottom.Image =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Left_Bottom_Corner
Me.img_Border_Left_Bottom.Location = New
System.Drawing.Point(0, 314)
Me.img_Border_Left_Bottom.Name = "img_Border_Left_Bottom"
Me.img_Border_Left_Bottom.Size = New System.Drawing.Size(514,
8)
Me.img_Border_Left_Bottom.TabIndex = 13
Me.img_Border_Left_Bottom.TabStop = False
'
'img_Border_Right_Corner
'
Me.img_Border_Right_Corner.Anchor =
CType((System.Windows.Forms.AnchorStyles.Bottom Or
System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Right_Corner.BackgroundImage =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Right_Bottom_Corner
Me.img_Border_Right_Corner.Location = New
System.Drawing.Point(514, 314)
Me.img_Border_Right_Corner.Name = "img_Border_Right_Corner"
Me.img_Border_Right_Corner.Size = New System.Drawing.Size(8,
8)
Me.img_Border_Right_Corner.TabIndex = 12
Me.img_Border_Right_Corner.TabStop = False
'
'img_Border_Right_Top
'
Me.img_Border_Right_Top.Anchor =
CType(((System.Windows.Forms.AnchorStyles.Top Or
System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles)
Me.img_Border_Right_Top.BackgroundImage =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Right_Side_Tile
Me.img_Border_Right_Top.Image =
Global.Vista_Basic_Window_Shell.My.Resources.Resources.Border_Right_Side_Top
Me.img_Border_Right_Top.Location = New
System.Drawing.Point(514, 27)
Me.img_Border_Right_Top.Name = "img_Border_Right_Top"
Me.img_Border_Right_Top.Size = New System.Drawing.Size(8, 287)
Me.img_Border_Right_Top.TabIndex = 11
Me.img_Border_Right_Top.TabStop = False
'
'Vista_Basic_Window
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.img_Border_Left_Top_Corner)
Me.Controls.Add(Me.img_Border_Right_Top_Corner)
Me.Controls.Add(Me.img_Border_Minimize)
Me.Controls.Add(Me.img_Border_Maximize)
Me.Controls.Add(Me.img_Border_Close)
Me.Controls.Add(Me.img_Border_Titlebar)
Me.Controls.Add(Me.img_Border_Left_Top)
Me.Controls.Add(Me.img_Border_Left_Bottom)
Me.Controls.Add(Me.img_Border_Right_Corner)
Me.Controls.Add(Me.img_Border_Right_Top)
Me.Margin = New System.Windows.Forms.Padding(8, 28, 8, 8)
Me.Name = "Vista_Basic_Window"
Me.Size = New System.Drawing.Size(522, 322)
CType(Me.img_Border_Left_Top_Corner,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Right_Top_Corner,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Minimize,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Maximize,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Close,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Titlebar,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Left_Top,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Left_Bottom,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Right_Corner,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.img_Border_Right_Top,
System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents img_Border_Left_Top_Corner As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Right_Top_Corner As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Minimize As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Maximize As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Close As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Titlebar As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Left_Top As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Left_Bottom As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Right_Corner As
System.Windows.Forms.PictureBox
Friend WithEvents img_Border_Right_Top As
System.Windows.Forms.PictureBox
End Class
Thanks a lot, Rob