Click here to Skip to main content
15,885,806 members
Articles / Programming Languages / Visual Basic

Structured Print Document Utility

Rate me:
Please Sign up or sign in to vote.
4.79/5 (19 votes)
14 Jun 2014CPOL6 min read 152.3K   3.5K   95  
A set of classes for creating structured documents
Namespace StructuredDocuments

Public Class Form_StructuredPrintDocumentEditor
    Inherits System.Windows.Forms.Form

#Region "Private members"
    Private _StructuredDocument As StructuredDocuments.StructuredPrintDocument
#End Region

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    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.
    Friend WithEvents ToolBar_DocumentDesigner As System.Windows.Forms.ToolBar
    Friend WithEvents Panel_PageProperties As System.Windows.Forms.Panel
        Friend WithEvents MainMenu_DocumentEditor As System.Windows.Forms.MainMenu
    Friend WithEvents MenuItem_Pages As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem_Data As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem_View As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem_Help As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem_Pages_New As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem_View_Pages As System.Windows.Forms.MenuItem
        Friend WithEvents lvwPrintDocumentAreaWriterProviders As System.Windows.Forms.ListView
        Friend WithEvents ColumnProviderName As System.Windows.Forms.ColumnHeader
        Friend WithEvents MenuItem_Data_Add As System.Windows.Forms.MenuItem
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            Me.ToolBar_DocumentDesigner = New System.Windows.Forms.ToolBar
            Me.Panel_PageProperties = New System.Windows.Forms.Panel
            Me.lvwPrintDocumentAreaWriterProviders = New System.Windows.Forms.ListView
            Me.ColumnProviderName = New System.Windows.Forms.ColumnHeader
            Me.MainMenu_DocumentEditor = New System.Windows.Forms.MainMenu
            Me.MenuItem_Pages = New System.Windows.Forms.MenuItem
            Me.MenuItem_Pages_New = New System.Windows.Forms.MenuItem
            Me.MenuItem_Data = New System.Windows.Forms.MenuItem
            Me.MenuItem_Data_Add = New System.Windows.Forms.MenuItem
            Me.MenuItem_View = New System.Windows.Forms.MenuItem
            Me.MenuItem_View_Pages = New System.Windows.Forms.MenuItem
            Me.MenuItem_Help = New System.Windows.Forms.MenuItem
            Me.Panel_PageProperties.SuspendLayout()
            Me.SuspendLayout()
            '
            'ToolBar_DocumentDesigner
            '
            Me.ToolBar_DocumentDesigner.DropDownArrows = True
            Me.ToolBar_DocumentDesigner.Location = New System.Drawing.Point(0, 0)
            Me.ToolBar_DocumentDesigner.Name = "ToolBar_DocumentDesigner"
            Me.ToolBar_DocumentDesigner.ShowToolTips = True
            Me.ToolBar_DocumentDesigner.Size = New System.Drawing.Size(472, 42)
            Me.ToolBar_DocumentDesigner.TabIndex = 0
            '
            'Panel_PageProperties
            '
            Me.Panel_PageProperties.Controls.Add(Me.lvwPrintDocumentAreaWriterProviders)
            Me.Panel_PageProperties.Dock = System.Windows.Forms.DockStyle.Left
            Me.Panel_PageProperties.Location = New System.Drawing.Point(0, 42)
            Me.Panel_PageProperties.Name = "Panel_PageProperties"
            Me.Panel_PageProperties.Size = New System.Drawing.Size(88, 331)
            Me.Panel_PageProperties.TabIndex = 1
            '
            'lvwPrintDocumentAreaWriterProviders
            '
            Me.lvwPrintDocumentAreaWriterProviders.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnProviderName})
            Me.lvwPrintDocumentAreaWriterProviders.Dock = System.Windows.Forms.DockStyle.Left
            Me.lvwPrintDocumentAreaWriterProviders.Location = New System.Drawing.Point(0, 0)
            Me.lvwPrintDocumentAreaWriterProviders.Name = "lvwPrintDocumentAreaWriterProviders"
            Me.lvwPrintDocumentAreaWriterProviders.Size = New System.Drawing.Size(121, 331)
            Me.lvwPrintDocumentAreaWriterProviders.TabIndex = 0
            Me.lvwPrintDocumentAreaWriterProviders.View = System.Windows.Forms.View.List
            '
            'ColumnProviderName
            '
            Me.ColumnProviderName.Text = "Area Style"
            '
            'MainMenu_DocumentEditor
            '
            Me.MainMenu_DocumentEditor.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem_Pages, Me.MenuItem_Data, Me.MenuItem_View, Me.MenuItem_Help})
            '
            'MenuItem_Pages
            '
            Me.MenuItem_Pages.Index = 0
            Me.MenuItem_Pages.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem_Pages_New})
            Me.MenuItem_Pages.Text = "&Pages"
            '
            'MenuItem_Pages_New
            '
            Me.MenuItem_Pages_New.Index = 0
            Me.MenuItem_Pages_New.Text = "&New"
            '
            'MenuItem_Data
            '
            Me.MenuItem_Data.Index = 1
            Me.MenuItem_Data.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem_Data_Add})
            Me.MenuItem_Data.Text = "&Data"
            '
            'MenuItem_Data_Add
            '
            Me.MenuItem_Data_Add.Index = 0
            Me.MenuItem_Data_Add.Text = "&Add"
            '
            'MenuItem_View
            '
            Me.MenuItem_View.Index = 2
            Me.MenuItem_View.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem_View_Pages})
            Me.MenuItem_View.Text = "&View"
            '
            'MenuItem_View_Pages
            '
            Me.MenuItem_View_Pages.Index = 0
            Me.MenuItem_View_Pages.Text = "&Pages"
            '
            'MenuItem_Help
            '
            Me.MenuItem_Help.Index = 3
            Me.MenuItem_Help.Text = "&Help"
            '
            'Form_StructuredPrintDocumentEditor
            '
            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.ClientSize = New System.Drawing.Size(472, 373)
            Me.Controls.Add(Me.Panel_PageProperties)
            Me.Controls.Add(Me.ToolBar_DocumentDesigner)
            Me.Menu = Me.MainMenu_DocumentEditor
            Me.Name = "Form_StructuredPrintDocumentEditor"
            Me.Text = "Structured Print Document Editor"
            Me.Panel_PageProperties.ResumeLayout(False)
            Me.ResumeLayout(False)

        End Sub

#End Region

#Region "Public interface"
    Public Property StructuredDocument() As StructuredDocuments.StructuredPrintDocument
        Get
            Return _StructuredDocument
        End Get
        Set(ByVal Value As StructuredDocuments.StructuredPrintDocument)
            _StructuredDocument = Value
            If _StructuredDocument.Pages.Count = 0 Then
                _StructuredDocument.Pages.AddPage(New StructuredDocuments.StructuredPrintPage)
            End If
            Call RefreshCurrentPage()
        End Set
    End Property
#End Region

#Region "Private methods"
    Private Sub RefreshCurrentPage()

    End Sub
#End Region

#Region "Menu click handlers"
#Region "Pages menu"

#End Region

#Region "View menu"
    Private Sub MenuItem_View_Pages_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem_View_Pages.Click

        Dim fPages As New Form_ViewPages
        fPages.ShowDialog(Me)

    End Sub
#End Region

#Region "Help menu"

#End Region
#End Region

End Class
End Namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Ireland Ireland
C# / SQL Server developer
Microsoft MVP (Azure) 2017
Microsoft MVP (Visual Basic) 2006, 2007

Comments and Discussions