Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.Windows.Forms

Namespace SelectPdf.Samples
	Public Partial Class MainForm
		Inherits Form
		Public Sub New()
			InitializeComponent()
		End Sub

        Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            For Each control As Control In Me.Controls
                If TypeOf control Is MdiClient Then
                    control.BackColor = menuStrip.BackColor
                    Exit For
                End If
            Next
        End Sub

        Private Sub ExitToolsStripMenuItem_Click(sender As Object, e As EventArgs) Handles exitToolStripMenuItem.Click
            Me.Close()
        End Sub

        Private Sub CascadeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles cascadeToolStripMenuItem.Click
            LayoutMdi(MdiLayout.Cascade)
        End Sub

        Private Sub TileVerticalToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles tileVerticalToolStripMenuItem.Click
            LayoutMdi(MdiLayout.TileVertical)
        End Sub

        Private Sub TileHorizontalToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles tileHorizontalToolStripMenuItem.Click
            LayoutMdi(MdiLayout.TileHorizontal)
        End Sub

        Private Sub ArrangeIconsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles arrangeIconsToolStripMenuItem.Click
            LayoutMdi(MdiLayout.ArrangeIcons)
        End Sub

        Private Sub CloseAllToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles closeAllToolStripMenuItem.Click
            For Each childForm As Form In MdiChildren
                childForm.Close()
            Next
        End Sub

        Private Sub aboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles aboutToolStripMenuItem.Click
            System.Diagnostics.Process.Start("https://selectpdf.com/pdf-library-for-net/")
        End Sub

        Private Sub visitSelectPdf_Click(sender As Object, e As EventArgs) Handles visitSelectPdf.Click
            System.Diagnostics.Process.Start("https://selectpdf.com")
        End Sub

        Private Sub gettingStartedToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles gettingStartedToolStripMenuItem.Click
            Dim form As New GettingStarted()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub documentPropertiesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles documentPropertiesToolStripMenuItem.Click
            Dim form As New DocumentProperties()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub gettingStartedToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles gettingStartedToolStripMenuItem1.Click
            Dim form As New HtmlToPdfConverter()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub convertUrlToPdfToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles convertUrlToPdfToolStripMenuItem.Click
            Dim form As New ConvertUrlToPdf()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub convertHtmlCodeToPdfToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles convertHtmlCodeToPdfToolStripMenuItem.Click
            Dim form As New ConvertHtmlCodeToPdf()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfViewerPreferencesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfViewerPreferencesToolStripMenuItem.Click
            Dim form As New PdfViewerPreferences()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfPageSettingsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfPageSettingsToolStripMenuItem.Click
            Dim form As New PageSettings()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfSecuritySettingsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfSecuritySettingsToolStripMenuItem.Click
            Dim form As New PdfSecurity()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfElementsRenderingPositionsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfElementsRenderingPositionsToolStripMenuItem.Click
            Dim form As New PdfElementsPositions()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfTextElementPropertiesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfTextElementPropertiesToolStripMenuItem.Click
            Dim form As New PdfTextElementForm()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfImageElementPropertiesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfImageElementPropertiesToolStripMenuItem.Click
            Dim form As New PdfImageElementForm()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfGraphicElementsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfGraphicElementsToolStripMenuItem.Click
            Dim form As New GraphicElements()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfLinksToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfLinksToolStripMenuItem.Click
            Dim form As New PdfLinks()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfBookmarksToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfBookmarksToolStripMenuItem.Click
            Dim form As New PdfBookmarks()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfTemplatesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfTemplatesToolStripMenuItem.Click
            Dim form As New PdfTemplates()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub headersAndFootersToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles headersAndFootersToolStripMenuItem.Click
            Dim form As New HeadersAndFooters()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfStampsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfStampsToolStripMenuItem.Click
            Dim form As New PdfStamps()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfWatermarksToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfWatermarksToolStripMenuItem.Click
            Dim form As New PdfWatermarks()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pageNumberingToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pageNumberingToolStripMenuItem.Click
            Dim form As New PageNumbering()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfMergeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfMergeToolStripMenuItem.Click
            Dim form As New PdfMerge()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfSplitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfSplitToolStripMenuItem.Click
            Dim form As New PdfSplit()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfDocumentPropertiesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pdfDocumentPropertiesToolStripMenuItem.Click
            Dim form As New PdfConverterProperties()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfViewerPreferencesToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles pdfViewerPreferencesToolStripMenuItem1.Click
            Dim form As New PdfConverterViewerPreferences()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pdfSecuritySettingsToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles pdfSecuritySettingsToolStripMenuItem1.Click
            Dim form As New PdfConverterSecurity()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub multipleUrlsToOnePdfDocumentToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles multipleUrlsToOnePdfDocumentToolStripMenuItem.Click
            Dim form As New ConvertMultipleUrlsToPdf()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub conversionDelayToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles conversionDelayToolStripMenuItem.Click
            Dim form As New ConversionDelay()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub headersAndFootersToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles headersAndFootersToolStripMenuItem1.Click
            Dim form As New HtmlToPdfHeadersAndFooters()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub pageBreaksToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles pageBreaksToolStripMenuItem.Click
            Dim form As New PageBreaks()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub automaticBookmarksToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles automaticBookmarksToolStripMenuItem.Click
            Dim form As New AutomaticBookmarks()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub hTTPHeadersToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles hTTPHeadersToolStripMenuItem.Click
            Dim form As New HttpHeaders()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub hTTPCookiesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles hTTPCookiesToolStripMenuItem.Click
            Dim form As New HttpCookies()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub startConversionFromJavascriptToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles startConversionFromJavascriptToolStripMenuItem.Click
            Dim form As New ConvertFromJs()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub mediaTypesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles mediaTypesToolStripMenuItem.Click
            Dim form As New MediaTypes()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub internalAndExternalLinksToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles internalAndExternalLinksToolStripMenuItem.Click
            Dim form As New HtmlToPdfConverterLinks()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub partialPageConversionToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles partialPageConversionToolStripMenuItem.Click
            Dim form As New PartialConversion()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub excludeElementsFromConversionToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles excludeElementsFromConversionToolStripMenuItem.Click
            Dim form As New ExcludeFromConversion()
            form.MdiParent = Me
            form.Show()
        End Sub

        Private Sub contentsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles contentsToolStripMenuItem.Click
            System.Diagnostics.Process.Start("https://selectpdf.com/docs/")
        End Sub
    End Class
End Namespace

