frmOptions.frm
上传用户:bcdefg2008
上传日期:2013-02-28
资源大小:144k
文件大小:11k
源码类别:

Email服务器

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmOptions 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Options"
  6.    ClientHeight    =   6495
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   6150
  10.    ClipControls    =   0   'False
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   6495
  16.    ScaleWidth      =   6150
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   2  '屏幕中心
  19.    Tag             =   "Options"
  20.    Begin VB.CheckBox chkDelMails 
  21.       Caption         =   "Delete received mails"
  22.       Height          =   255
  23.       Left            =   480
  24.       TabIndex        =   25
  25.       Top             =   5640
  26.       Width           =   5415
  27.    End
  28.    Begin VB.CheckBox ckLogin 
  29.       Caption         =   "Use SMTP Login"
  30.       Height          =   255
  31.       Left            =   480
  32.       TabIndex        =   24
  33.       ToolTipText     =   "Use Login Authorization When Connecting to a Host"
  34.       Top             =   5040
  35.       Width           =   5235
  36.    End
  37.    Begin VB.CheckBox ckPopLogin 
  38.       Caption         =   "Use POP Login before sending an E-Mail"
  39.       Height          =   255
  40.       Left            =   480
  41.       TabIndex        =   23
  42.       ToolTipText     =   "Use Login Authorization When Connecting to a Host"
  43.       Top             =   5340
  44.       Width           =   5415
  45.    End
  46.    Begin VB.CommandButton cmdOK 
  47.       Caption         =   "OK"
  48.       Height          =   360
  49.       Left            =   120
  50.       TabIndex        =   1
  51.       Tag             =   "OK"
  52.       Top             =   6120
  53.       Width           =   2895
  54.    End
  55.    Begin VB.CommandButton cmdCancel 
  56.       Cancel          =   -1  'True
  57.       Caption         =   "Cancel"
  58.       Height          =   360
  59.       Left            =   3000
  60.       TabIndex        =   3
  61.       Tag             =   "Cancel"
  62.       Top             =   6120
  63.       Width           =   3015
  64.    End
  65.    Begin VB.PictureBox picOptions 
  66.       BorderStyle     =   0  'None
  67.       Height          =   3780
  68.       Index           =   3
  69.       Left            =   -20000
  70.       ScaleHeight     =   3840.968
  71.       ScaleMode       =   0  'User
  72.       ScaleWidth      =   5745.64
  73.       TabIndex        =   5
  74.       TabStop         =   0   'False
  75.       Top             =   480
  76.       Width           =   5685
  77.       Begin VB.Frame fraSample4 
  78.          Caption         =   "Sample 4"
  79.          Height          =   2022
  80.          Left            =   505
  81.          TabIndex        =   9
  82.          Tag             =   "Sample 4"
  83.          Top             =   502
  84.          Width           =   2033
  85.       End
  86.    End
  87.    Begin VB.PictureBox picOptions 
  88.       BorderStyle     =   0  'None
  89.       Height          =   3780
  90.       Index           =   2
  91.       Left            =   -20000
  92.       ScaleHeight     =   3840.968
  93.       ScaleMode       =   0  'User
  94.       ScaleWidth      =   5745.64
  95.       TabIndex        =   7
  96.       TabStop         =   0   'False
  97.       Top             =   480
  98.       Width           =   5685
  99.       Begin VB.Frame fraSample3 
  100.          Caption         =   "Sample 3"
  101.          Height          =   2022
  102.          Left            =   406
  103.          TabIndex        =   8
  104.          Tag             =   "Sample 3"
  105.          Top             =   403
  106.          Width           =   2033
  107.       End
  108.    End
  109.    Begin VB.PictureBox picOptions 
  110.       BorderStyle     =   0  'None
  111.       Height          =   3780
  112.       Index           =   1
  113.       Left            =   -20000
  114.       ScaleHeight     =   3840.968
  115.       ScaleMode       =   0  'User
  116.       ScaleWidth      =   5745.64
  117.       TabIndex        =   4
  118.       TabStop         =   0   'False
  119.       Top             =   480
  120.       Width           =   5685
  121.       Begin VB.Frame fraSample2 
  122.          Caption         =   "Sample 2"
  123.          Height          =   2022
  124.          Left            =   307
  125.          TabIndex        =   6
  126.          Tag             =   "Sample 2"
  127.          Top             =   305
  128.          Width           =   2033
  129.       End
  130.    End
  131.    Begin VB.PictureBox picOptions 
  132.       BorderStyle     =   0  'None
  133.       Height          =   4500
  134.       Index           =   0
  135.       Left            =   210
  136.       ScaleHeight     =   4572.581
  137.       ScaleMode       =   0  'User
  138.       ScaleWidth      =   5745.64
  139.       TabIndex        =   2
  140.       TabStop         =   0   'False
  141.       Top             =   480
  142.       Width           =   5685
  143.       Begin VB.Frame Frame1 
  144.          Caption         =   "From Information"
  145.          Height          =   1335
  146.          Left            =   120
  147.          TabIndex        =   18
  148.          Top             =   3120
  149.          Width           =   5535
  150.          Begin VB.TextBox txtfromaddress 
  151.             Height          =   285
  152.             Left            =   1560
  153.             TabIndex        =   22
  154.             Top             =   840
  155.             Width           =   3735
  156.          End
  157.          Begin VB.TextBox txtfromname 
  158.             Height          =   285
  159.             Left            =   1560
  160.             TabIndex        =   21
  161.             Top             =   360
  162.             Width           =   3735
  163.          End
  164.          Begin VB.Label Label2 
  165.             Caption         =   "From Address:"
  166.             Height          =   255
  167.             Left            =   120
  168.             TabIndex        =   20
  169.             Top             =   840
  170.             Width           =   1455
  171.          End
  172.          Begin VB.Label Label1 
  173.             Caption         =   "From Name:"
  174.             Height          =   255
  175.             Left            =   120
  176.             TabIndex        =   19
  177.             Top             =   360
  178.             Width           =   1455
  179.          End
  180.       End
  181.       Begin VB.TextBox txtPassword 
  182.          Height          =   375
  183.          IMEMode         =   3  'DISABLE
  184.          Left            =   1680
  185.          PasswordChar    =   "*"
  186.          TabIndex        =   17
  187.          Top             =   2520
  188.          Width           =   3975
  189.       End
  190.       Begin VB.TextBox txtUsername 
  191.          Height          =   375
  192.          Left            =   1680
  193.          TabIndex        =   16
  194.          Top             =   1800
  195.          Width           =   3975
  196.       End
  197.       Begin VB.TextBox txtPop3Server 
  198.          Height          =   375
  199.          Left            =   1680
  200.          TabIndex        =   15
  201.          Top             =   1080
  202.          Width           =   3975
  203.       End
  204.       Begin VB.TextBox txtServer 
  205.          Height          =   375
  206.          Left            =   1680
  207.          TabIndex        =   11
  208.          Top             =   240
  209.          Width           =   3975
  210.       End
  211.       Begin VB.Label lbl_popserver 
  212.          Caption         =   "POP3 Server:"
  213.          Height          =   375
  214.          Left            =   660
  215.          TabIndex        =   14
  216.          Top             =   1140
  217.          Width           =   975
  218.       End
  219.       Begin VB.Image img_popserver 
  220.          Height          =   480
  221.          Left            =   120
  222.          Picture         =   "frmOptions.frx":0000
  223.          Top             =   960
  224.          Width           =   480
  225.       End
  226.       Begin VB.Image img_popusername 
  227.          Height          =   480
  228.          Left            =   120
  229.          Picture         =   "frmOptions.frx":030A
  230.          Top             =   1800
  231.          Width           =   480
  232.       End
  233.       Begin VB.Image img_poppassword 
  234.          Height          =   480
  235.          Left            =   120
  236.          Picture         =   "frmOptions.frx":0FD4
  237.          Top             =   2460
  238.          Width           =   480
  239.       End
  240.       Begin VB.Label lbl_popusername 
  241.          Caption         =   "Username:"
  242.          Height          =   195
  243.          Left            =   720
  244.          TabIndex        =   13
  245.          Top             =   1920
  246.          Width           =   795
  247.       End
  248.       Begin VB.Label lbl_poppassword 
  249.          Caption         =   "Password:"
  250.          Height          =   195
  251.          Left            =   660
  252.          TabIndex        =   12
  253.          Top             =   2580
  254.          Width           =   735
  255.       End
  256.       Begin VB.Image img_server 
  257.          Height          =   480
  258.          Left            =   120
  259.          Picture         =   "frmOptions.frx":12DE
  260.          Top             =   120
  261.          Width           =   480
  262.       End
  263.       Begin VB.Label lbl_server 
  264.          Caption         =   "SMTP Server:"
  265.          Height          =   255
  266.          Left            =   660
  267.          TabIndex        =   10
  268.          Top             =   300
  269.          Width           =   1095
  270.       End
  271.    End
  272.    Begin MSComctlLib.TabStrip tbsOptions 
  273.       Height          =   5925
  274.       Left            =   120
  275.       TabIndex        =   0
  276.       Top             =   120
  277.       Width           =   5895
  278.       _ExtentX        =   10398
  279.       _ExtentY        =   10451
  280.       _Version        =   393216
  281.       BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
  282.          NumTabs         =   1
  283.          BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  284.             Caption         =   "Mail Transport"
  285.             ImageVarType    =   2
  286.          EndProperty
  287.       EndProperty
  288.    End
  289. End
  290. Attribute VB_Name = "frmOptions"
  291. Attribute VB_GlobalNameSpace = False
  292. Attribute VB_Creatable = False
  293. Attribute VB_PredeclaredId = True
  294. Attribute VB_Exposed = False
  295. Option Explicit
  296. Private Sub cmdCancel_Click()
  297.     Me.Hide
  298. End Sub
  299. Private Sub cmdOK_Click()
  300.   Dim c As Control
  301.     For Each c In Controls
  302.         If TypeOf c Is TextBox Then
  303.             SaveIni "Account", c.Name, c.Text
  304.         End If
  305.         If TypeOf c Is CheckBox Then
  306.             SaveIni "Account", c.Name, c.Value
  307.         End If
  308.     Next c
  309.     Me.Hide
  310. End Sub
  311. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  312.   Dim I As Integer
  313.     I = tbsOptions.SelectedItem.index
  314.     'handle ctrl+tab to move to the next tab
  315.     If (Shift And 3) = 2 And KeyCode = vbKeyTab Then
  316.         If I = tbsOptions.Tabs.Count Then
  317.             'last tab so we need to wrap to tab 1
  318.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(1)
  319.           Else
  320.             'increment the tab
  321.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(I + 1)
  322.         End If
  323.       ElseIf (Shift And 3) = 3 And KeyCode = vbKeyTab Then
  324.         If I = 1 Then
  325.             'last tab so we need to wrap to tab 1
  326.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(tbsOptions.Tabs.Count)
  327.           Else
  328.             'increment the tab
  329.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(I - 1)
  330.         End If
  331.     End If
  332. End Sub
  333. Private Sub tbsOptions_Click()
  334.   Dim I As Integer
  335.     'show and enable the selected tab's controls
  336.     'and hide and disable all others
  337.     For I = 0 To tbsOptions.Tabs.Count - 1
  338.         If I = tbsOptions.SelectedItem.index - 1 Then
  339.             picOptions(I).Left = 210
  340.             picOptions(I).Enabled = True
  341.           Else
  342.             picOptions(I).Left = -20000
  343.             picOptions(I).Enabled = False
  344.         End If
  345.     Next I
  346. End Sub
  347. ':) Ulli's VB Code Formatter V2.12.7 (19.06.2002 23:13:04) 2 + 81 = 83 Lines