Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'ERROR: An unhandled exception of type 'System.NullReferenceException' occurred in pog.exe
- Private Sub ToolStripButton45_Click(sender As Object, e As EventArgs) Handles ToolStripButton45.Click
- tcViewer.TabPages.Add(New ViewerTabPage(tcViewer))
- MsgBox(tcViewer.Controls("picSource0").Name)
- 'err here
- End Sub
- Class ViewerTabPage
- Inherits TabPage
- Private pnLeftTop As New Panel
- Private pnRightTop As New Panel
- Private pnBottom As New Panel
- Public picSource As New PictureBox
- Private txtZoom As New TextBox
- Private rtSourceContent As New RichTextBox
- Private rtNotesSource As New RichTextBox
- Private ToolStripRT As New ToolStrip
- Private ToolStripB As New ToolStrip
- Private tbZoom As New TrackBar
- Sub New(targettabcontrol As TabControl)
- MyBase.New()
- Me.SuspendLayout()
- Me.Controls.Add(pnLeftTop)
- With pnLeftTop
- .Anchor = AnchorStyles.Left Or AnchorStyles.Top
- .Location = New Point(31, 3)
- .BackColor = Color.Blue
- .Width = (targettabcontrol.Width / 2) - 7 - 30
- .Height = (targettabcontrol.Height / 10) * 6.5 '65%
- .Name = "XXX"
- '.Visible = False
- End With
- Me.Controls.Add(tbZoom)
- With tbZoom
- .Orientation = Orientation.Vertical
- .Location = New Point(0, 3)
- .Height = pnLeftTop.Height
- .Width = 30
- End With
- Me.Controls.Add(pnRightTop)
- With pnRightTop
- .Anchor = AnchorStyles.Right Or AnchorStyles.Top
- .Location = New Point(-(targettabcontrol.Width / 2) + 205, 3)
- .BackColor = Color.Red
- .Width = (targettabcontrol.Width / 2) - 7 - 33
- .Height = (targettabcontrol.Height / 10) * 6.5 '65%
- .Name = "YYY"
- '.Visible = False
- End With
- Me.Controls.Add(ToolStripRT)
- With ToolStripRT
- .AutoSize = False
- .LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow
- .Size = New Point(33, pnRightTop.Height - 1)
- .BackColor = Color.Aqua
- .Dock = DockStyle.None
- .Left = targettabcontrol.Width - 40
- .Top = 3
- End With
- Me.Controls.Add(pnBottom)
- With pnBottom
- .Anchor = AnchorStyles.Bottom
- .Location = New Point(-390, -((targettabcontrol.Height / 10) * 3.5) + 130) 'pnLeftTop.Height + 10)
- .BackColor = Color.Green
- .Width = (targettabcontrol.Width) - 10 - 33
- .Height = (targettabcontrol.Height / 10) * 3.5 '65%
- .Name = "ZZZ"
- End With
- Me.Controls.Add(ToolStripB)
- With ToolStripB
- .AutoSize = False
- .LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow
- .Size = New Point(33, pnBottom.Height - 1)
- .BackColor = Color.Bisque
- .Dock = DockStyle.None
- .Top = ToolStripRT.Height + 5
- .Left = targettabcontrol.Width - 40
- End With
- pnLeftTop.Controls.Add(picSource)
- With picSource
- .Name = "picSource" & targettabcontrol.TabPages.Count - 1
- MsgBox(.Name)
- .BackColor = Color.Yellow
- .Dock = DockStyle.Fill
- .BackgroundImageLayout = ImageLayout.Zoom
- End With
- pnLeftTop.Controls.Add(txtZoom)
- With txtZoom
- .Visible = False
- End With
- pnRightTop.Controls.Add(rtSourceContent)
- With rtSourceContent
- .BackColor = Color.Purple
- .Dock = DockStyle.Fill
- End With
- pnBottom.Controls.Add(rtNotesSource)
- With rtNotesSource
- .BackColor = Color.AliceBlue
- .Dock = DockStyle.Fill
- End With
- Me.ResumeLayout(False)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement