📄 mainform.vb
字号:
#Region "Complier Options"
Option Strict On
Option Explicit On
#End Region
#Region "Imported Classes"
Imports Microsoft.VisualBasic.ControlChars
#End Region
Public Class MainForm
#Region "Inherited Class"
Inherits System.Windows.Forms.Form
#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.
Private WithEvents MainTabControl As System.Windows.Forms.TabControl
Private WithEvents SettingsTabPage As System.Windows.Forms.TabPage
Private WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Private WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Private WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Private WithEvents ToolTip1 As System.Windows.Forms.ToolTip
Private WithEvents ContactsTabPage As System.Windows.Forms.TabPage
Private WithEvents AddContactButton As System.Windows.Forms.Button
Private WithEvents ContactInformationGroupBox As System.Windows.Forms.GroupBox
Private WithEvents ContactsDataGrid As System.Windows.Forms.DataGrid
Private WithEvents RefreshButton As System.Windows.Forms.Button
Private WithEvents MyDataSet As System.Data.DataSet
Private WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Private WithEvents Label1 As System.Windows.Forms.Label
Private WithEvents Label2 As System.Windows.Forms.Label
Private WithEvents Label3 As System.Windows.Forms.Label
Private WithEvents MSCRMServerTextBox As System.Windows.Forms.TextBox
Private WithEvents UserNameTextBox As System.Windows.Forms.TextBox
Private WithEvents PasswordTextBox As System.Windows.Forms.TextBox
Private WithEvents Label4 As System.Windows.Forms.Label
Private WithEvents Domain As System.Windows.Forms.TextBox
Friend WithEvents ModifyContactButton As System.Windows.Forms.Button
Private WithEvents ExitMenuItem As System.Windows.Forms.MenuItem
Private WithEvents AboutMenuItem As System.Windows.Forms.MenuItem
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.MainTabControl = New System.Windows.Forms.TabControl
Me.ContactsTabPage = New System.Windows.Forms.TabPage
Me.ContactInformationGroupBox = New System.Windows.Forms.GroupBox
Me.ModifyContactButton = New System.Windows.Forms.Button
Me.RefreshButton = New System.Windows.Forms.Button
Me.ContactsDataGrid = New System.Windows.Forms.DataGrid
Me.MyDataSet = New System.Data.DataSet
Me.AddContactButton = New System.Windows.Forms.Button
Me.SettingsTabPage = New System.Windows.Forms.TabPage
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.Label4 = New System.Windows.Forms.Label
Me.Domain = New System.Windows.Forms.TextBox
Me.Label3 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.MSCRMServerTextBox = New System.Windows.Forms.TextBox
Me.UserNameTextBox = New System.Windows.Forms.TextBox
Me.PasswordTextBox = New System.Windows.Forms.TextBox
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.ExitMenuItem = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
Me.AboutMenuItem = New System.Windows.Forms.MenuItem
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.MainTabControl.SuspendLayout()
Me.ContactsTabPage.SuspendLayout()
Me.ContactInformationGroupBox.SuspendLayout()
CType(Me.ContactsDataGrid, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.MyDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SettingsTabPage.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'MainTabControl
'
Me.MainTabControl.Controls.Add(Me.ContactsTabPage)
Me.MainTabControl.Controls.Add(Me.SettingsTabPage)
Me.MainTabControl.Dock = System.Windows.Forms.DockStyle.Fill
Me.MainTabControl.Location = New System.Drawing.Point(0, 0)
Me.MainTabControl.Name = "MainTabControl"
Me.MainTabControl.SelectedIndex = 0
Me.MainTabControl.Size = New System.Drawing.Size(472, 326)
Me.MainTabControl.TabIndex = 0
'
'ContactsTabPage
'
Me.ContactsTabPage.Controls.Add(Me.ContactInformationGroupBox)
Me.ContactsTabPage.Location = New System.Drawing.Point(4, 22)
Me.ContactsTabPage.Name = "ContactsTabPage"
Me.ContactsTabPage.Size = New System.Drawing.Size(464, 300)
Me.ContactsTabPage.TabIndex = 0
Me.ContactsTabPage.Text = "Contacts"
'
'ContactInformationGroupBox
'
Me.ContactInformationGroupBox.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ContactInformationGroupBox.Controls.Add(Me.ModifyContactButton)
Me.ContactInformationGroupBox.Controls.Add(Me.RefreshButton)
Me.ContactInformationGroupBox.Controls.Add(Me.ContactsDataGrid)
Me.ContactInformationGroupBox.Controls.Add(Me.AddContactButton)
Me.ContactInformationGroupBox.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.ContactInformationGroupBox.Location = New System.Drawing.Point(8, 8)
Me.ContactInformationGroupBox.Name = "ContactInformationGroupBox"
Me.ContactInformationGroupBox.Size = New System.Drawing.Size(448, 285)
Me.ContactInformationGroupBox.TabIndex = 1
Me.ContactInformationGroupBox.TabStop = False
Me.ContactInformationGroupBox.Text = "Contact Information"
'
'ModifyContactButton
'
Me.ModifyContactButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom
Me.ModifyContactButton.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.ModifyContactButton.Location = New System.Drawing.Point(312, 253)
Me.ModifyContactButton.Name = "ModifyContactButton"
Me.ModifyContactButton.Size = New System.Drawing.Size(88, 23)
Me.ModifyContactButton.TabIndex = 2
Me.ModifyContactButton.Text = "Modify Contact"
'
'RefreshButton
'
Me.RefreshButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom
Me.RefreshButton.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.RefreshButton.Location = New System.Drawing.Point(192, 253)
Me.RefreshButton.Name = "RefreshButton"
Me.RefreshButton.TabIndex = 1
Me.RefreshButton.Text = "Refresh"
'
'ContactsDataGrid
'
Me.ContactsDataGrid.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ContactsDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.ContactsDataGrid.ColumnHeadersVisible = False
Me.ContactsDataGrid.DataMember = ""
Me.ContactsDataGrid.DataSource = Me.MyDataSet
Me.ContactsDataGrid.FlatMode = True
Me.ContactsDataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.ContactsDataGrid.Location = New System.Drawing.Point(8, 16)
Me.ContactsDataGrid.Name = "ContactsDataGrid"
Me.ContactsDataGrid.ParentRowsVisible = False
Me.ContactsDataGrid.ReadOnly = True
Me.ContactsDataGrid.Size = New System.Drawing.Size(432, 229)
Me.ContactsDataGrid.TabIndex = 0
'
'MyDataSet
'
Me.MyDataSet.DataSetName = "MSCRMContacts"
Me.MyDataSet.Locale = New System.Globalization.CultureInfo("en-US")
'
'AddContactButton
'
Me.AddContactButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom
Me.AddContactButton.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.AddContactButton.Location = New System.Drawing.Point(64, 253)
Me.AddContactButton.Name = "AddContactButton"
Me.AddContactButton.TabIndex = 0
Me.AddContactButton.Text = "Add Contact"
'
'SettingsTabPage
'
Me.SettingsTabPage.Controls.Add(Me.GroupBox1)
Me.SettingsTabPage.Location = New System.Drawing.Point(4, 22)
Me.SettingsTabPage.Name = "SettingsTabPage"
Me.SettingsTabPage.Size = New System.Drawing.Size(464, 279)
Me.SettingsTabPage.TabIndex = 1
Me.SettingsTabPage.Text = "Settings"
'
'GroupBox1
'
Me.GroupBox1.Anchor = System.Windows.Forms.AnchorStyles.None
Me.GroupBox1.Controls.Add(Me.Label4)
Me.GroupBox1.Controls.Add(Me.Domain)
Me.GroupBox1.Controls.Add(Me.Label3)
Me.GroupBox1.Controls.Add(Me.Label2)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Controls.Add(Me.MSCRMServerTextBox)
Me.GroupBox1.Controls.Add(Me.UserNameTextBox)
Me.GroupBox1.Controls.Add(Me.PasswordTextBox)
Me.GroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.GroupBox1.Location = New System.Drawing.Point(32, 48)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(400, 183)
Me.GroupBox1.TabIndex = 1
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Microsoft CRM Settings"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(32, 64)
Me.Label4.Name = "Label4"
Me.Label4.TabIndex = 7
Me.Label4.Text = "Domain:"
'
'Domain
'
Me.Domain.Location = New System.Drawing.Point(144, 64)
Me.Domain.Name = "Domain"
Me.Domain.Size = New System.Drawing.Size(236, 20)
Me.Domain.TabIndex = 6
Me.Domain.Text = ""
Me.ToolTip1.SetToolTip(Me.Domain, "The domain of the MSCRM user. Example: ""MyDomain"".")
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(32, 96)
Me.Label3.Name = "Label3"
Me.Label3.TabIndex = 5
Me.Label3.Text = "User Name"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(32, 32)
Me.Label2.Name = "Label2"
Me.Label2.TabIndex = 4
Me.Label2.Text = "MSCRM Server"
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(32, 128)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 3
Me.Label1.Text = "Password"
'
'MSCRMServerTextBox
'
Me.MSCRMServerTextBox.Location = New System.Drawing.Point(144, 32)
Me.MSCRMServerTextBox.Name = "MSCRMServerTextBox"
Me.MSCRMServerTextBox.Size = New System.Drawing.Size(236, 20)
Me.MSCRMServerTextBox.TabIndex = 2
Me.MSCRMServerTextBox.Text = ""
Me.ToolTip1.SetToolTip(Me.MSCRMServerTextBox, "The name of the MSCRM Server. Example ""ApplicationServer01"".")
'
'UserNameTextBox
'
Me.UserNameTextBox.Location = New System.Drawing.Point(144, 96)
Me.UserNameTextBox.Name = "UserNameTextBox"
Me.UserNameTextBox.Size = New System.Drawing.Size(236, 20)
Me.UserNameTextBox.TabIndex = 1
Me.UserNameTextBox.Text = ""
Me.ToolTip1.SetToolTip(Me.UserNameTextBox, "The user name of the MSCRM user. Example: ""John.Smith"".")
'
'PasswordTextBox
'
Me.PasswordTextBox.Location = New System.Drawing.Point(144, 128)
Me.PasswordTextBox.Name = "PasswordTextBox"
Me.PasswordTextBox.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.PasswordTextBox.Size = New System.Drawing.Size(236, 20)
Me.PasswordTextBox.TabIndex = 0
Me.PasswordTextBox.Text = ""
Me.ToolTip1.SetToolTip(Me.PasswordTextBox, "The password of the user.")
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem3})
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.ExitMenuItem})
Me.MenuItem1.Text = "File"
'
'ExitMenuItem
'
Me.ExitMenuItem.Index = 0
Me.ExitMenuItem.Text = "Exit"
'
'MenuItem3
'
Me.MenuItem3.Index = 1
Me.MenuItem3.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.AboutMenuItem})
Me.MenuItem3.Text = "Help"
'
'AboutMenuItem
'
Me.AboutMenuItem.Index = 0
Me.AboutMenuItem.Text = "About"
'
'MainForm
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(472, 326)
Me.Controls.Add(Me.MainTabControl)
Me.Menu = Me.MainMenu1
Me.MinimumSize = New System.Drawing.Size(480, 360)
Me.Name = "MainForm"
Me.Text = "Add or modify a contact "
Me.MainTabControl.ResumeLayout(False)
Me.ContactsTabPage.ResumeLayout(False)
Me.ContactInformationGroupBox.ResumeLayout(False)
CType(Me.ContactsDataGrid, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.MyDataSet, System.ComponentModel.ISupportInitialize).EndInit()
Me.SettingsTabPage.ResumeLayout(False)
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
#Region "Variables"
#Region "Private Variables"
#End Region
#End Region
#Region "Base Class Events"
Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Catch ex As Exception
ShowErrorMessage(ex)
End Try
End Sub
#End Region
#Region "Methods"
#Region "Private Methods"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -