⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 aotu english chinese dictionary
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "汽车专业英汉/汉英词典"
   ClientHeight    =   6225
   ClientLeft      =   60
   ClientTop       =   510
   ClientWidth     =   11880
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   6225
   ScaleWidth      =   11880
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Height          =   360
      Left            =   5280
      Picture         =   "Form1.frx":7D42
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   240
      Width           =   375
   End
   Begin VB.Frame Frame2 
      Height          =   495
      Left            =   6120
      TabIndex        =   8
      Top             =   195
      Width           =   2655
      Begin VB.OptionButton Optionyh 
         Caption         =   "英译汉"
         Height          =   255
         Left            =   120
         TabIndex        =   10
         Top             =   120
         Width           =   855
      End
      Begin VB.OptionButton Optionhy 
         Caption         =   "汉译英"
         ForeColor       =   &H000000FF&
         Height          =   255
         Left            =   1440
         TabIndex        =   9
         Top             =   120
         Value           =   -1  'True
         Width           =   855
      End
   End
   Begin VB.Frame Frame1 
      Height          =   495
      Left            =   9000
      TabIndex        =   5
      Top             =   195
      Width           =   2655
      Begin VB.OptionButton Optionjing 
         Caption         =   "完全匹配"
         Height          =   255
         Left            =   1440
         TabIndex        =   7
         Top             =   120
         Width           =   1095
      End
      Begin VB.OptionButton Optionmohu 
         Caption         =   "模糊匹配"
         ForeColor       =   &H000000FF&
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   120
         Value           =   -1  'True
         Width           =   1095
      End
   End
   Begin VB.PictureBox P1 
      Height          =   5175
      Left            =   240
      ScaleHeight     =   5115
      ScaleWidth      =   11355
      TabIndex        =   2
      Top             =   840
      Width           =   11415
      Begin VB.VScrollBar VScroll1 
         Height          =   4935
         Left            =   10920
         TabIndex        =   4
         Top             =   120
         Width           =   375
      End
      Begin VB.PictureBox P2 
         AutoRedraw      =   -1  'True
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   2.45745e5
         Left            =   0
         ScaleHeight     =   2.45685e5
         ScaleWidth      =   10875
         TabIndex        =   3
         Top             =   0
         Width           =   10935
      End
   End
   Begin VB.CommandButton Command1 
      Height          =   360
      Left            =   4560
      Picture         =   "Form1.frx":89B6
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   240
      Width           =   375
   End
   Begin VB.TextBox Text3 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   4695
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim ss As String, N As Integer, temp As String, FindStr As String
P2.Cls
If Text3.Text = "" Then Exit Sub
Open App.Path + "\autoenglish.dat" For Input As #1
N = 0

If Optionjing.Value = True Then
    FindStr = " " + Text3.Text + " "
Else
    FindStr = Text3.Text
End If
Do While Not EOF(1)
    temp = ss
    Line Input #1, ss
    ss = " " + ss + " "
    If InStr(1, ss, FindStr, vbTextCompare) Then
        N = N + 1
        If Optionhy.Value Then
            P2.ForeColor = vbRed
            P2.Print Str(N) + "," + ss
            Line Input #1, ss
            P2.ForeColor = vbBlue
            P2.Print vbTab + ss + vbCrLf
        Else
            P2.ForeColor = vbRed
            P2.Print Str(N) + "," + ss
            P2.ForeColor = vbBlue
            P2.Print vbTab + temp + vbCrLf
        End If
        
        
    End If
    If N < P1.Height / 800 Then
        P2.Height = P1.Height
        VScroll1.Min = 0
        VScroll1.Max = P2.Height - P1.Height
        If VScroll1.Max < 0 Then VScroll1.Enabled = False
    ElseIf N > P1.Height / 800 And N < 43 Then
        P2.Height = 730 * (N + 1)
        VScroll1.Min = 0
        VScroll1.Max = P2.Height - P1.Height
        If VScroll1.Max < 0 Then VScroll1.Enabled = False
    ElseIf N = 43 Then
        P2.Height = 32400
        VScroll1.Min = 0
        VScroll1.Max = P2.Height - P1.Height
        If VScroll1.Max < 0 Then VScroll1.Enabled = False
        P2.ForeColor = vbBlack
        P2.Print "……" + vbCrLf
        P2.Print "如果没找到,建议输入更精确的词语进行查找。"
        Exit Do
    End If
Loop
Close #1
Text3.SetFocus
End Sub

Private Sub Command2_Click()
Form2.Show
End Sub

Private Sub Form_Load()
P2.Left = 0
P2.Top = 0
P2.Width = P1.Width - VScroll1.Width
P2.Height = P1.Height
VScroll1.Top = 0
VScroll1.Left = P1.Width - VScroll1.Width - 50
VScroll1.Height = P1.Height
VScroll1.Min = 0
VScroll1.Max = P2.Height - P1.Height
If VScroll1.Max < 0 Then VScroll1.Enabled = False
End Sub

Private Sub Form_Resize()
P1.Left = 240
P1.Width = Form1.Width - 600
P1.Height = Form1.Height - 1620
P2.Left = 0
P2.Top = 0
P2.Width = P1.Width - VScroll1.Width
If P2.Height < P1.Height Then P2.Height = P1.Height
VScroll1.Top = 0
VScroll1.Left = P1.Width - VScroll1.Width - 50
VScroll1.Height = P1.Height - 50
VScroll1.Min = 0
VScroll1.Max = P2.Height - P1.Height
If VScroll1.Max < 0 Then VScroll1.Enabled = False
Frame1.Left = Form1.Width - 3000
Frame2.Left = Form1.Width - 5880
End Sub

Private Sub Optionhy_Click()
    Optionhy.ForeColor = vbRed
    Optionyh.ForeColor = vbBlack
End Sub

Private Sub Optionjing_Click()
    Optionjing.ForeColor = vbRed
    Optionmohu.ForeColor = vbBlack

End Sub

Private Sub Optionmohu_Click()
    Optionmohu.ForeColor = vbRed
    Optionjing.ForeColor = vbBlack
End Sub

Private Sub Optionyh_Click()
    Optionyh.ForeColor = vbRed
    Optionhy.ForeColor = vbBlack
End Sub

Private Sub VScroll1_Change()
P2.Top = -VScroll1.Value
End Sub

Private Sub Text3_GotFocus()
Text3.SelStart = 0
Text3.SelLength = Len(Text3.Text)
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
Dim Han As Boolean
If KeyAscii = 13 Then
    Call Command1_Click
End If
'判断是英-》汉还是汉-》英,如果英汉 默认为精确查找
Han = False
If KeyAscii < 0 Then Han = True

If Han Then
    Optionmohu.Value = True
    Optionmohu.ForeColor = vbRed
    Optionjing.ForeColor = vbBlack
    Optionhy.Value = True
    Optionhy.ForeColor = vbRed
    Optionyh.ForeColor = vbBlack
Else
    Optionjing.Value = True
    Optionmohu.ForeColor = vbBlack
    Optionjing.ForeColor = vbRed
    Optionyh.Value = True
    Optionhy.ForeColor = vbBlack
    Optionyh.ForeColor = vbRed
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -