home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Hex_Editor207856872007.psc / Frm_Jump.frm < prev    next >
Text File  |  2006-01-29  |  3KB  |  129 lines

  1. VERSION 5.00
  2. Begin VB.Form Frm_Jump 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Jump To Position"
  5.    ClientHeight    =   1365
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   2790
  9.    ControlBox      =   0   'False
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1365
  14.    ScaleWidth      =   2790
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton Command2 
  17.       Caption         =   "Cancel"
  18.       Height          =   375
  19.       Left            =   1440
  20.       TabIndex        =   5
  21.       Top             =   840
  22.       Width           =   1215
  23.    End
  24.    Begin VB.CommandButton Command1 
  25.       Caption         =   "Goto"
  26.       Default         =   -1  'True
  27.       Height          =   375
  28.       Left            =   120
  29.       TabIndex        =   4
  30.       Top             =   840
  31.       Width           =   1215
  32.    End
  33.    Begin VB.TextBox Dec_val 
  34.       Height          =   285
  35.       Left            =   1440
  36.       MaxLength       =   10
  37.       TabIndex        =   3
  38.       Top             =   360
  39.       Width           =   1215
  40.    End
  41.    Begin VB.TextBox Hex_Val 
  42.       Height          =   285
  43.       Left            =   120
  44.       MaxLength       =   8
  45.       TabIndex        =   2
  46.       Top             =   360
  47.       Width           =   1215
  48.    End
  49.    Begin VB.Label Label2 
  50.       Caption         =   "Dec Value"
  51.       Height          =   255
  52.       Left            =   1440
  53.       TabIndex        =   1
  54.       Top             =   120
  55.       Width           =   1215
  56.    End
  57.    Begin VB.Label Label1 
  58.       Caption         =   "Hex Value"
  59.       Height          =   255
  60.       Left            =   120
  61.       TabIndex        =   0
  62.       Top             =   120
  63.       Width           =   1095
  64.    End
  65. End
  66. Attribute VB_Name = "Frm_Jump"
  67. Attribute VB_GlobalNameSpace = False
  68. Attribute VB_Creatable = False
  69. Attribute VB_PredeclaredId = True
  70. Attribute VB_Exposed = False
  71. Option Explicit
  72. Private Auto_Update As Boolean
  73.  
  74. Private Sub Command1_Click()
  75. Jump_Loc = Val(Dec_val.Text)
  76. If Jump_Loc > File_Len Then Jump_Loc = File_Len
  77. Unload Me
  78. End Sub
  79.  
  80. Private Sub Command2_Click()
  81. Jump_Loc = -1
  82. Unload Me
  83. End Sub
  84.  
  85. Private Sub Dec_val_Change()
  86. If Auto_Update Then Exit Sub
  87. Auto_Update = True
  88. Hex_Val.Text = DecadeToHex(Dec_val.Text)
  89. Auto_Update = False
  90. End Sub
  91.  
  92. Private Sub Dec_val_KeyPress(KeyAscii As Integer)
  93. Select Case KeyAscii 'Filter inputs.. (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
  94.     Case 1 To 7
  95.         KeyAscii = 0
  96.     'Case 8  ' No trap for backspace...
  97.     Case 9 To 47
  98.         KeyAscii = 0
  99.     Case 58 To 205
  100.         KeyAscii = 0
  101. End Select
  102. End Sub
  103.  
  104.  
  105. Private Sub Hex_Val_Change()
  106. If Auto_Update Then Exit Sub
  107. Auto_Update = True
  108. Dec_val.Text = HexToDecade(Hex_Val.Text)
  109. Auto_Update = False
  110. End Sub
  111.  
  112. Private Sub Hex_Val_KeyPress(KeyAscii As Integer)
  113. Select Case KeyAscii 'Filter inputs.. (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
  114.     Case 1 To 7
  115.         KeyAscii = 0
  116.     'Case 8  ' No trap for backspace...
  117.     Case 9 To 47
  118.         KeyAscii = 0
  119.     Case 58 To 64
  120.         KeyAscii = 0
  121.     Case 71 To 96
  122.         KeyAscii = 0
  123.     Case 97 To 102
  124.         KeyAscii = KeyAscii - 32 ' Change to upper case code..
  125.     Case 103 To 255
  126.         KeyAscii = 0
  127. End Select
  128. End Sub
  129.