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

📄 frmaddwords.frm

📁 原代码功能:是一个的单词记学习器,实现单词的浏览,还可以自己添加自己所要学习的单词,用一个对话框进行单词的浏览.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmAddwords 
   Caption         =   "添加单词"
   ClientHeight    =   3765
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6435
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3765
   ScaleWidth      =   6435
   StartUpPosition =   3  '窗口缺省
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "D:\deskpet\wordreading\wordlib.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   375
      Left            =   360
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "words"
      Top             =   3240
      Visible         =   0   'False
      Width           =   1140
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "添加"
      Height          =   375
      Left            =   2760
      TabIndex        =   6
      Top             =   3240
      Width           =   1455
   End
   Begin VB.TextBox txtInterpret 
      Height          =   975
      Left            =   1920
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   5
      Top             =   1800
      Width           =   3135
   End
   Begin VB.TextBox txtProperty 
      Height          =   375
      Left            =   1920
      TabIndex        =   3
      Top             =   1200
      Width           =   3135
   End
   Begin VB.TextBox txtSpell 
      Height          =   375
      Left            =   1920
      TabIndex        =   1
      Top             =   480
      Width           =   3135
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "解释"
      Height          =   255
      Left            =   720
      TabIndex        =   4
      Top             =   2160
      Width           =   375
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "词性"
      Height          =   375
      Left            =   720
      TabIndex        =   2
      Top             =   1200
      Width           =   615
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "拼写"
      Height          =   255
      Left            =   720
      TabIndex        =   0
      Top             =   600
      Width           =   615
   End
End
Attribute VB_Name = "frmAddwords"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
 Call loadConfig
 Me.BackColor = Trim(CONFSTR.stylecolor)
 Data1.DatabaseName = ROOT & "/wordlib.mdb"
 Data1.RecordSource = Trim(CONFSTR.initlib)
 Data1.Refresh
End Sub

Private Sub cmdAdd_Click()

Dim wspell As String, winterpret As String, wproperty As String
Dim wlen As Byte, s As String, topasc

 wspell = Trim(txtSpell.Text)
 wproperty = Trim(txtProperty.Text)
 winterpret = Trim(txtInterpret.Text)
 wlen = Len(wspell)
 
 If wlen <= 0 Or wlen > 50 Then
 MsgBox "您填写的单词不符合设定的规则", vbInformation, "提示"
 txtSpell.SetFocus
 ElseIf LenB(wproperty) <= 0 Or LenB(wproperty) > 10 Then
 MsgBox "单词词性不符合设定的规则", vbInformation, "提示"
 txtProperty.SetFocus
 ElseIf LenB(winterpret) <= 0 Or LenB(winiterpret) > 50 Then
  MsgBox "单词词意不符合设定的规则", vbInformation, "提示"
 txtInterpret.SetFocus
 Else
  

  For i = 1 To wlen
   s = UCase(Mid(wspell, i, 1))
   If Asc(s) > 90 Or Asc(s) < 65 Then
    MsgBox "单词不符合英文的规则", vbInformation, "提示"
    txtSpell.SetFocus
    Exit Sub
   End If
  Next

topasc = UCase(Mid(wspell, 1, 1))
topasc = CInt(Asc(topasc))

    With Data1
   .Recordset.AddNew
   .Recordset("spell") = wspell
   .Recordset("property") = wproperty
   .Recordset("interpret") = winterpret
   .Recordset("topasc") = topasc
   .Recordset.Update
  End With
  txtSpell.Text = ""
  txtProperty.Text = ""
  txtInterpret.Text = ""
  MsgBox "单词" & txtSpell & "已经添加!", vbInformation, "提示"
  
End If

End Sub


⌨️ 快捷键说明

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