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 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 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 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 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 contentsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles contentsToolStripMenuItem.Click
            System.Diagnostics.Process.Start("https://selectpdf.com/html-to-pdf/docs/")
        End Sub
    End Class
End Namespace

