home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / maillst.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-26  |  6.9 KB  |  211 lines

  1. VERSION 4.00
  2. Begin VB.Form MailLst 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Mail List"
  5.    ClientHeight    =   3555
  6.    ClientLeft      =   2070
  7.    ClientTop       =   3270
  8.    ClientWidth     =   6630
  9.    Height          =   3915
  10.    Icon            =   "MAILLST.frx":0000
  11.    Left            =   2010
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   3555
  14.    ScaleWidth      =   6630
  15.    Top             =   2970
  16.    Width           =   6750
  17.    Begin VB.PictureBox Tools 
  18.       Align           =   2  'Align Bottom
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   615
  22.       Left            =   0
  23.       ScaleHeight     =   615
  24.       ScaleWidth      =   6630
  25.       TabIndex        =   2
  26.       Top             =   2940
  27.       Width           =   6630
  28.       Begin VB.Line Line1 
  29.          BorderColor     =   &H00FFFFFF&
  30.          Index           =   1
  31.          X1              =   0
  32.          X2              =   6660
  33.          Y1              =   15
  34.          Y2              =   15
  35.       End
  36.       Begin VB.Line Line1 
  37.          BorderColor     =   &H00000000&
  38.          Index           =   0
  39.          X1              =   0
  40.          X2              =   6660
  41.          Y1              =   0
  42.          Y2              =   0
  43.       End
  44.       Begin VB.Image PrtImage 
  45.          Height          =   480
  46.          Left            =   1200
  47.          Picture         =   "MAILLST.frx":030A
  48.          Top             =   60
  49.          Width           =   480
  50.       End
  51.       Begin VB.Image Trash 
  52.          Height          =   480
  53.          Left            =   300
  54.          Picture         =   "MAILLST.frx":0614
  55.          Top             =   60
  56.          Width           =   480
  57.       End
  58.    End
  59.    Begin VB.ListBox MList 
  60.       Height          =   2205
  61.       Left            =   90
  62.       MultiSelect     =   2  'Extended
  63.       TabIndex        =   0
  64.       Top             =   360
  65.       Width           =   6495
  66.    End
  67.    Begin VB.Label Headings 
  68.       AutoSize        =   -1  'True
  69.       BackStyle       =   0  'Transparent
  70.       Caption         =   "Listbox Headings"
  71.       BeginProperty Font 
  72.          name            =   "Courier New"
  73.          charset         =   0
  74.          weight          =   400
  75.          size            =   9
  76.          underline       =   0   'False
  77.          italic          =   0   'False
  78.          strikethrough   =   0   'False
  79.       EndProperty
  80.       Height          =   225
  81.       Left            =   180
  82.       TabIndex        =   1
  83.       Top             =   60
  84.       Width           =   1680
  85.    End
  86.    Begin VB.Image NewMail 
  87.       Height          =   480
  88.       Left            =   5880
  89.       Picture         =   "MAILLST.frx":091E
  90.       Top             =   2820
  91.       Visible         =   0   'False
  92.       Width           =   480
  93.    End
  94.    Begin VB.Image nonew 
  95.       Height          =   480
  96.       Left            =   5280
  97.       Picture         =   "MAILLST.frx":0C28
  98.       Top             =   2880
  99.       Visible         =   0   'False
  100.       Width           =   480
  101.    End
  102. Attribute VB_Name = "MailLst"
  103. Attribute VB_Creatable = False
  104. Attribute VB_Exposed = False
  105. ' Module variable to hold MouseDown position information.
  106. Dim ListX, ListY
  107. Private Sub Form_Load()
  108.     ' Resize the form.
  109.     Height = 3945
  110.     Call Tools_Resize
  111.      ' Set list box headings.
  112.      a$ = Mid$(Format$("From", "!" + String$(25, "@")), 1, 25)
  113.      b$ = Mid$(Format$("Subject", "!" + String$(35, "@")), 1, 35)
  114.      c$ = "Date"
  115.      Headings = a$ + b$ + c$
  116. End Sub
  117. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  118.     ' If the user is closing the application, let this form unload.
  119.     If UnloadMode = 4 Then
  120.         ' Unloading is permitted.
  121.     Else
  122.         ' If the user is still logged on, minimize the form rather than closing it.
  123.         If VBMail.MapiMess.SessionID <> 0 Then
  124.             Me.WindowState = 1
  125.             Cancel = True
  126.         End If
  127.     End If
  128. End Sub
  129. Private Sub Form_Resize()
  130.     ' If the form isn't minimized, resize the list box to fit the form.
  131.     If WindowState <> 1 Then
  132.         If VBMail.DispTools.Checked Then
  133.             xHeight% = Tools.Height
  134.         Else
  135.             xHeight% = 0
  136.         End If
  137.         ' Check for the minimum form height.
  138.         If Height < 2500 - xHeight% Then
  139.             Height = 2500
  140.             Exit Sub
  141.         End If
  142.         MList.Width = ScaleWidth - MList.Left - 90
  143.         MList.Height = ScaleHeight - 90 - MList.Top - xHeight%
  144.     End If
  145. End Sub
  146. Private Sub MList_Click()
  147. ' Set the message index and enable the
  148. ' Previous and Next buttons as needed.
  149.     Select Case MList.ListIndex
  150.         Case 0
  151.             VBMail.Previous.Enabled = False
  152.         Case MList.ListCount - 1
  153.             VBMail.Next.Enabled = False
  154.         Case Else
  155.             VBMail.Previous.Enabled = True
  156.             VBMail.Next.Enabled = True
  157.     End Select
  158.     VBMail.MapiMess.MsgIndex = MList.ListIndex
  159. End Sub
  160. Private Sub MList_DBLClick()
  161. ' Check to see if the message is currently viewed,
  162. ' and if it isn't, load it into a new form.
  163.     If Not MailLst.MList.ItemData(MailLst.MList.ListIndex) Then
  164.        Dim Msg As New MsgView
  165.        Call LoadMessage(MailLst.MList.ListIndex, Msg)
  166.        MailLst.MList.ItemData(MailLst.MList.ListIndex) = True
  167.     Else
  168.         ' Search through the active windows to
  169.         ' find the window with the correct message to view.
  170.         For i = 0 To Forms.Count - 1
  171.             If TypeOf Forms(i) Is MsgView Then
  172.                 If Val(Forms(i).Tag) = MailLst.MList.ListIndex Then
  173.                     Forms(i).Show
  174.                     Exit Sub
  175.                 End If
  176.             End If
  177.         Next i
  178.      End If
  179. End Sub
  180. Private Sub MList_KeyPress(KeyAscii As Integer)
  181.     ' If the user presses ENTER, process the action as a DblClick event.
  182.     If KeyAscii = 13 Then
  183.         Call MList_DBLClick
  184.     End If
  185. End Sub
  186. Private Sub MList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  187.     ' Save the X and Y positions to determine the start of the drag-and-drop action.
  188.     ListX = X
  189.     ListY = Y
  190. End Sub
  191. Private Sub MList_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  192.     ' If the mouse button is down and the X,Y position has changed, start dragging.
  193.     If Button = 1 And ((X <> ListX) Or (Y <> ListY)) Then
  194.         MList.Drag 1
  195.     End If
  196. End Sub
  197. Private Sub PrtImage_DragDrop(Source As Control, X As Single, Y As Single)
  198.     ' Same as File.PrintMessage on the VBMAIL File menu.
  199.     Call PrintMail
  200. End Sub
  201. Private Sub Tools_Resize()
  202.     ' Adjust the width of the lines on the top of the toolbar.
  203.     Line1(0).X2 = Tools.Width
  204.     Line1(1).X2 = Tools.Width
  205.     Tools.Refresh
  206. End Sub
  207. Private Sub Trash_DragDrop(Source As Control, X As Single, Y As Single)
  208.     ' Delete a message (Delete Button or Edit.Delete).
  209.    Call DeleteMessage
  210. End Sub
  211.