home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 October / pcp156b.iso / handson / files / copyvbwk.exe / examples / GotoLineDialog.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-03-31  |  2.2 KB  |  81 lines

  1. VERSION 5.00
  2. Begin VB.Form GotoLineDialog 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Goto"
  5.    ClientHeight    =   1800
  6.    ClientLeft      =   2760
  7.    ClientTop       =   3750
  8.    ClientWidth     =   3765
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   1800
  13.    ScaleWidth      =   3765
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.TextBox Text1 
  16.       BeginProperty Font 
  17.          Name            =   "MS Sans Serif"
  18.          Size            =   12
  19.          Charset         =   0
  20.          Weight          =   400
  21.          Underline       =   0   'False
  22.          Italic          =   0   'False
  23.          Strikethrough   =   0   'False
  24.       EndProperty
  25.       Height          =   375
  26.       Left            =   1560
  27.       TabIndex        =   0
  28.       Top             =   360
  29.       Width           =   2055
  30.    End
  31.    Begin VB.CommandButton CancelButton 
  32.       Caption         =   "Cancel"
  33.       Height          =   375
  34.       Left            =   2400
  35.       TabIndex        =   2
  36.       Top             =   1200
  37.       Width           =   1215
  38.    End
  39.    Begin VB.CommandButton OKButton 
  40.       Caption         =   "OK"
  41.       Height          =   375
  42.       Left            =   360
  43.       TabIndex        =   1
  44.       Top             =   1200
  45.       Width           =   1215
  46.    End
  47.    Begin VB.Label Label1 
  48.       Caption         =   "Enter line number"
  49.       Height          =   615
  50.       Left            =   240
  51.       TabIndex        =   3
  52.       Top             =   360
  53.       Width           =   1215
  54.    End
  55. Attribute VB_Name = "GotoLineDialog"
  56. Attribute VB_GlobalNameSpace = False
  57. Attribute VB_Creatable = False
  58. Attribute VB_PredeclaredId = True
  59. Attribute VB_Exposed = False
  60. Option Explicit
  61. Public LineNumber As Long
  62. Private Sub CancelButton_Click()
  63. LineNumber = -1
  64. Me.Hide
  65. End Sub
  66. Private Sub Form_Load()
  67. LineNumber = -1
  68. End Sub
  69. Private Sub OKButton_Click()
  70. ' this isn't too bright - no checking (yet)
  71. ' ... really need to use an API here
  72. LineNumber = CLng(Text1)
  73. Me.Hide
  74. End Sub
  75. Private Sub Text1_KeyPress(KeyAscii As Integer)
  76. If KeyAscii = 13 Then
  77.     LineNumber = CLng(Text1)
  78.     Me.Hide
  79. End If
  80. End Sub
  81.