📄 editoutf.frm
字号:
VERSION 5.00
Begin VB.Form frmEditOutFreq
BorderStyle = 3 'Fixed Dialog
Caption = "Edit Output Frequency"
ClientHeight = 2415
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 6015
Icon = "EditOutF.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2415
ScaleWidth = 6015
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.VScrollBar vscDecTWVal
Height = 435
Left = 260
Max = -1
Min = 1
TabIndex = 16
Top = 360
Width = 200
End
Begin VB.VScrollBar vscOutputFreq
Height = 435
Left = 260
Max = -1
Min = 1
TabIndex = 15
Top = 360
Visible = 0 'False
Width = 200
End
Begin VB.TextBox txtOutputFreqVal
Alignment = 1 'Right Justify
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 480
MaxLength = 11
MultiLine = -1 'True
TabIndex = 0
Text = "EditOutF.frx":000C
Top = 360
Width = 2295
End
Begin VB.Frame fraTunningWord
Caption = "Tuning Word Values"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 120
TabIndex = 9
Top = 960
Width = 4455
Begin VB.TextBox txtTW
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 3
Left = 120
MaxLength = 8
MultiLine = -1 'True
TabIndex = 6
Text = "EditOutF.frx":001A
Top = 840
Width = 975
End
Begin VB.TextBox txtTW
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 2
Left = 1080
MaxLength = 8
MultiLine = -1 'True
TabIndex = 5
Text = "EditOutF.frx":0023
Top = 840
Width = 975
End
Begin VB.TextBox txtTW
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 1
Left = 2040
MaxLength = 8
MultiLine = -1 'True
TabIndex = 4
Text = "EditOutF.frx":002C
Top = 840
Width = 975
End
Begin VB.TextBox txtTW
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 0
Left = 3000
MaxLength = 8
MultiLine = -1 'True
TabIndex = 3
Text = "EditOutF.frx":0035
Top = 840
Width = 975
End
Begin VB.TextBox txtTWHex
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2760
MaxLength = 8
MultiLine = -1 'True
TabIndex = 2
Text = "EditOutF.frx":003E
Top = 360
Width = 1215
End
Begin VB.TextBox txtTWDec
Alignment = 1 'Right Justify
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 120
MultiLine = -1 'True
TabIndex = 1
Text = "EditOutF.frx":0049
Top = 360
Width = 1215
End
Begin VB.Label lblHex
BackStyle = 0 'Transparent
Caption = "Hex"
Height = 255
Index = 1
Left = 4080
TabIndex = 12
Top = 360
Width = 375
End
Begin VB.Label lblTWBin
BackStyle = 0 'Transparent
Caption = "Bin"
Height = 255
Left = 4080
TabIndex = 11
Top = 840
Width = 375
End
Begin VB.Label lblDec
Caption = "Dec"
Height = 255
Left = 1440
TabIndex = 10
Top = 360
Width = 375
End
End
Begin VB.CommandButton CancelButton
Caption = "Cancel"
Height = 375
Left = 4680
TabIndex = 8
Top = 600
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "OK"
Height = 375
Left = 4680
TabIndex = 7
Top = 120
Width = 1215
End
Begin VB.Shape shpOKHilight
BorderWidth = 3
Height = 375
Left = 4680
Top = 120
Width = 1215
End
Begin VB.Label lblMhz
Caption = "MHz"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2880
TabIndex = 14
Top = 420
Width = 615
End
Begin VB.Label Label1
Caption = "Output Frequency:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 13
Top = 120
Width = 1935
End
End
Attribute VB_Name = "frmEditOutFreq"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private CancelHit As Boolean
Private OldValue As String
Private EditTbox As TextBox
Private TWDecVal As Variant
'Private OutputFreqVal As String
Private OKHit As Boolean
Option Explicit
Private Sub CancelButton_Click()
'Cancel was hit
OKHit = False
'Hide the form
Me.Hide
End Sub
Private Sub Form_Unload(Cancel As Integer)
OKHit = False
'Release the pointer to the textbox being edited
Set EditTbox = Nothing
End Sub
Private Sub OKButton_Click()
'Ok button hit
OKHit = True
'Hide the form
Me.Hide
End Sub
Private Sub OKButton_GotFocus()
'Hide the hilight box
shpOKHilight.Visible = False
End Sub
Private Sub OKButton_LostFocus()
'Show the hilight box
shpOKHilight.Visible = True
End Sub
Private Sub txtOutputFreqVal_Change()
' Dim OutputFreqVal As String
' Dim TWDecVal As Variant
'
' If txtOutputFreqVal.Text <> "" Then
' 'Calculate the decimal tuning word
' TWDecVal = DecFix(CalculateDecTuningWord(CDbl(txtOutputFreqVal), CDbl(frmMain.txtExtClockFreq), TWBits))
' 'txtTWDec.Text = TWDecVal
' 'Update the other textboxes
' UpdateTW (TWDecVal)
' End If
End Sub
Private Sub txtOutputFreqVal_GotFocus()
SelectAllTxt txtOutputFreqVal
End Sub
Private Sub txtOutputFreqVal_KeyPress(KeyAscii As Integer)
Dim cncl As Boolean
Dim DecSepPos As Integer
'Filter out all keys but the ones that are needed
KeyAscii = NumericKeysFilter(KeyAscii)
KeyAscii = PlusMinusKeysFilter(KeyAscii)
Select Case KeyAscii
Case 69, 101: 'Alpha key
KeyAscii = 0
Case iDecSep 'Decimal Seperator
If InStr(1, txtOutputFreqVal.Text, sDecSep) And InStr(1, txtOutputFreqVal.SelText, sDecSep) = 0 Then
KeyAscii = 0
End If
Case 13: 'Enter key hit
KeyAscii = 0
'Validate the text box
' txtOutpuFreqVal_Validate Cncl
txtOutputFreqVal_Validate cncl
Case Else 'Only a passable key was pressed
'Get the position of the decimal seperator
DecSepPos = InStr(1, txtOutputFreqVal.Text, sDecSep)
If txtOutputFreqVal.SelStart < DecSepPos And DecSepPos < 4 Then
If IsPrintable(KeyAscii) Then
'Adjust the maximum length
Select Case DecSepPos
Case 2:
txtOutputFreqVal.MaxLength = 12
Case 3:
txtOutputFreqVal.MaxLength = 13
Case Else:
txtOutputFreqVal.MaxLength = 11
End Select
Else
Select Case DecSepPos
Case 2:
txtOutputFreqVal.MaxLength = 11
Case 3:
txtOutputFreqVal.MaxLength = 12
Case Else
txtOutputFreqVal.MaxLength = 11
End Select
End If
End If
End Select
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -