home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / howtos1r / frmview.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-11  |  3.9 KB  |  119 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmView 
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "View Current Graph"
  7.    ClientHeight    =   2550
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   6060
  11.    Icon            =   "frmView.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   170
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   404
  18.    StartUpPosition =   1  'CenterOwner
  19.    Begin VB.CommandButton cmdExport 
  20.       Caption         =   "Export To a Bitmap"
  21.       Height          =   375
  22.       Left            =   0
  23.       TabIndex        =   4
  24.       Top             =   2175
  25.       Width           =   6060
  26.    End
  27.    Begin VB.CommandButton cmdClose 
  28.       Cancel          =   -1  'True
  29.       Caption         =   "Close"
  30.       Height          =   375
  31.       Left            =   0
  32.       TabIndex        =   2
  33.       Top             =   1800
  34.       Width           =   6060
  35.    End
  36.    Begin VB.HScrollBar Scroll 
  37.       Height          =   240
  38.       LargeChange     =   100
  39.       Left            =   0
  40.       SmallChange     =   10
  41.       TabIndex        =   1
  42.       Top             =   1560
  43.       Width           =   6060
  44.    End
  45.    Begin VB.PictureBox Picture1 
  46.       BackColor       =   &H00000000&
  47.       Height          =   1620
  48.       Left            =   0
  49.       ScaleHeight     =   104
  50.       ScaleMode       =   3  'Pixel
  51.       ScaleWidth      =   400
  52.       TabIndex        =   0
  53.       Top             =   0
  54.       Width           =   6060
  55.       Begin MSComDlg.CommonDialog Dialog 
  56.          Left            =   1920
  57.          Top             =   840
  58.          _ExtentX        =   847
  59.          _ExtentY        =   847
  60.          _Version        =   327681
  61.          DefaultExt      =   "*.bmp"
  62.          DialogTitle     =   "Save"
  63.          Filter          =   "Bitmaps|*.bmp"
  64.          MaxFileSize     =   10000
  65.       End
  66.       Begin VB.PictureBox picView 
  67.          AutoRedraw      =   -1  'True
  68.          BackColor       =   &H00000000&
  69.          BorderStyle     =   0  'None
  70.          Height          =   1500
  71.          Left            =   5040
  72.          ScaleHeight     =   100
  73.          ScaleMode       =   3  'Pixel
  74.          ScaleWidth      =   10
  75.          TabIndex        =   3
  76.          Top             =   30
  77.          Width           =   150
  78.       End
  79.    End
  80. Attribute VB_Name = "frmView"
  81. Attribute VB_GlobalNameSpace = False
  82. Attribute VB_Creatable = False
  83. Attribute VB_PredeclaredId = True
  84. Attribute VB_Exposed = False
  85. Private Sub cmdClose_Click()
  86. frmGraph.lblopt(0).ForeColor = RGB(0, 255, 0)
  87. Unload Me
  88. End Sub
  89. Private Sub cmdExport_Click()
  90. On Error GoTo Twat:
  91. Dialog.InitDir = App.Path
  92. Dialog.ShowOpen
  93. If Dialog.Filename <> "" Then
  94.     SavePicture picView.Image, Dialog.Filename
  95.     MsgBox "Saved to '" & Dialog.Filename & "'", vbInformation, "Success"
  96. End If
  97. Exit Sub
  98. Twat:
  99. MsgBox "Could Not Save to '" & Dialog.Filename & "'", vbInformation, "No Success"
  100. End Sub
  101. Private Sub Form_Load()
  102. picView.Width = frmGraph.picGraph.Width
  103. picView.Left = Picture1.ScaleWidth - picView.Width
  104. Scroll.Max = picView.Width
  105. Scroll.Value = Scroll.Max
  106. 'NOTE: 1 less than a quater to allow for there being a row valued '0' on the X axis
  107. picView.Line (0, 24)-(picView.ScaleWidth, 24), RGB(128, 128, 128)
  108. picView.Line (0, 49)-(picView.ScaleWidth, 49), RGB(128, 128, 128)
  109. picView.Line (0, 74)-(picView.ScaleWidth, 74), RGB(128, 128, 128)
  110. End Sub
  111. Private Sub Picture1_Click()
  112. frmView.picView.Line (0, 24)-(picView.Width, 24), RGB(255, 255, 255)
  113. frmView.picView.Line (0, 49)-(picView.Width, 49), RGB(255, 255, 255)
  114. frmView.picView.Line (0, 74)-(picView.Width, 74), RGB(255, 255, 255)
  115. End Sub
  116. Private Sub Scroll_Change()
  117. picView.Left = Picture1.ScaleWidth - Scroll.Value
  118. End Sub
  119.