<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="CustomForm.aspx.vb" Inherits="CustomForm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headerContent" Runat="Server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="rightColumnContent" Runat="Server">
<textarea id="TextArea1" style="height:800px; width: 1000px;" cols="20" rows="2">
Public Sub createForm(ByVal title As String)
        'Create form and set the form properties
        Dim form1 As New Form()
        With form1
            .AccessibleDescription = "Data entry form"
            .AccessibleName = "Data form"
            .AccessibleRole = AccessibleRole.Default
            .BackColor = Color.Ivory
            .StartPosition = FormStartPosition.CenterScreen
            .Cursor = Cursors.Default
            .Font = New Drawing.Font(form1.Font.Name, 10, FontStyle.Regular)
            .Text = title
            .ForeColor = Color.Black
            .Width = 600
            .Height = 600
            .Name = "frm" & title
        End With

        '************************Create Top Menu Strip******************************
        Dim menuStrip1 As New MenuStrip()
        'File Menu
        Dim menuFile As New ToolStripMenuItem("File")
        Dim menuFileNew As New ToolStripMenuItem("New Profile")
        Dim menuFileSeparator1 As New ToolStripSeparator
        Dim menuFileExport As New ToolStripMenuItem("Export Profile")
        Dim menuFileImport As New ToolStripMenuItem("Import Profile")
        Dim menuFileSeparator2 As New ToolStripSeparator
        Dim menuFilePrint As New ToolStripMenuItem("Print")
        Dim menuFilePrintPreview As New ToolStripMenuItem("Print Preview")
        Dim menuFilePageSetup As New ToolStripMenuItem("Page Setup")
        Dim menuFileSeparator3 As New ToolStripSeparator
        Dim menuFileExit As New ToolStripMenuItem("Exit")
        menuFile.DropDown.Items.Add(menuFileNew)
        menuFile.DropDown.Items.Add(menuFileSeparator1)
        menuFile.DropDown.Items.Add(menuFileExport)
        menuFile.DropDown.Items.Add(menuFileImport)
        menuFile.DropDown.Items.Add(menuFileSeparator2)
        menuFile.DropDown.Items.Add(menuFilePrint)
        menuFile.DropDown.Items.Add(menuFilePrintPreview)
        menuFile.DropDown.Items.Add(menuFilePageSetup)
        menuFile.DropDown.Items.Add(menuFileSeparator3)
        menuFile.DropDown.Items.Add(menuFileExit)
        'Edit Menu
        Dim menuEdit As New ToolStripMenuItem("Edit")
        Dim menuEditCut As New ToolStripMenuItem("Cut")
        Dim menuEditCopy As New ToolStripMenuItem("Copy")
        Dim menuEditPaste As New ToolStripMenuItem("Paste")
        Dim menuEditSeparator1 As New ToolStripSeparator
        Dim menuEditPreferences As New ToolStripMenuItem("Preferences")
        menuEdit.DropDown.Items.Add(menuEditCut)
        menuEdit.DropDown.Items.Add(menuEditCopy)
        menuEdit.DropDown.Items.Add(menuEditPaste)
        menuEdit.DropDown.Items.Add(menuEditSeparator1)
        menuEdit.DropDown.Items.Add(menuEditPreferences)
        'View Menu
        Dim menuView As New ToolStripMenuItem("View")
        Dim menuViewEnterData As New ToolStripMenuItem("Enter Data")
        Dim menuViewSearchData As New ToolStripMenuItem("Search Data")
        Dim menuViewViewData As New ToolStripMenuItem("View Data")
        menuView.DropDown.Items.Add(menuViewEnterData)
        menuView.DropDown.Items.Add(menuViewSearchData)
        menuView.DropDown.Items.Add(menuViewViewData)
        'Help Menu
        Dim menuHelp As New ToolStripMenuItem("Help")
        Dim menuContents As New ToolStripMenuItem("Contents")
        Dim menuHelpSeparator1 As New ToolStripSeparator
        Dim menuAbout As New ToolStripMenuItem("About")
        menuHelp.DropDown.Items.Add(menuContents)
        menuHelp.DropDown.Items.Add(menuHelpSeparator1)
        menuHelp.DropDown.Items.Add(menuAbout)

        menuStrip1.Items.Add(menuFile)
        menuStrip1.Items.Add(menuEdit)
        menuStrip1.Items.Add(menuView)
        menuStrip1.Items.Add(menuHelp)
        '************************End Create Top Menu Strip****************************

        Dim saveButton As New Button()
        With saveButton
            .Text = "Save"
            .TextAlign = ContentAlignment.MiddleCenter
            .Name = "btnSave"
            .AccessibleRole = AccessibleRole.Default
            .AccessibleDescription = "Saves data to database"
            .AccessibleName = "Save Button"
            .Location = New Point(180, 500)
        End With

        Dim deleteButton As New Button()
        With deleteButton
            .Text = "Delete"
            .TextAlign = ContentAlignment.MiddleCenter
            .Name = "btnDelete"
            .AccessibleRole = AccessibleRole.Default
            .AccessibleDescription = "Deletes currently selected data"
            .AccessibleName = "Delete Button"
            .Location = New Point(290, 500)
        End With

        Dim exitButton As New Button()
        With exitButton
            .Text = "Exit"
            .TextAlign = ContentAlignment.MiddleCenter
            .Name = "btnExit"
            .AccessibleRole = AccessibleRole.Default
            .AccessibleDescription = "Exits the form"
            .AccessibleName = "Exit Button"
            .Location = New Point(390, 500)
        End With

        form1.SuspendLayout()
        form1.Controls.Add(menuStrip1)
        form1.Controls.Add(saveButton)
        form1.Controls.Add(deleteButton)
        form1.Controls.Add(exitButton)
        form1.ResumeLayout()
        form1.ShowDialog()
    End Sub
</textarea>

</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="footerContent" Runat="Server">
</asp:Content>

