form1.frm

来自「vb电子书籍」· FRM 代码 · 共 111 行

FRM
111
字号
   VERSION 5.00
   Begin VB.Form Form1
      BackColor       =   &H00E0E0E0&
      Caption         =   "登录窗口"
      ClientHeight    =   1635
      ClientLeft      =   60
      ClientTop       =   345
      ClientWidth     =   4080
      ControlBox      =   0   'False
      Icon            =   "Form1.frx":0000
      LinkTopic       =   "Form1"
      MaxButton       =   0   'False
      MDIChild        =   -1  'True
      MinButton       =   0   'False
      ScaleHeight     =   1635
      ScaleWidth      =   4080
      Begin VB.TextBox Text1
         Appearance      =   0  'Flat
         BackColor       =   &H00E0E0E0&
         Height          =   270
         Index           =   1
         Left            =   1080
         TabIndex        =   4
         Top             =   840
         Width           =   975
      End
      Begin VB.CommandButton Command2
         Caption         =   "放弃"
         Height          =   270
         Left            =   2640
         TabIndex        =   3
         Top             =   840
         Width           =   1095
      End
      Begin VB.CommandButton Command1
         Caption         =   "确定"
         Height          =   270
         Left            =   2640
         TabIndex        =   2
         Top             =   480
         Width           =   1095
      End
      Begin VB.TextBox Text1
         Appearance      =   0  'Flat
         BackColor       =   &H00E0E0E0&
         Height          =   270
         Index           =   0
         Left            =   1080
         TabIndex        =   1
         Top             =   480
         Width           =   975
      End
      Begin VB.Label Label1
         BackStyle       =   0  'Transparent
         Caption         =   "姓名:         学号:"
         BeginProperty Font
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   480
         TabIndex        =   0
         Top             =   480
         Width           =   735
      End
   End
   Attribute VB_Name = "Form1"
   Attribute VB_GlobalNameSpace = False
   Attribute VB_Creatable = False
   Attribute VB_PredeclaredId = True
   Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
Dim record_no As Integer, xmzy As stutype

'##################################################################
'## 过程名称:Command1_Click
'## 参数: 无
'##################################################################
Private Sub Command1_Click()
    Open mpath + "xm.dat" For Random As #1 Len = Len(xmzy)
    record_no = LOF(1) / Len(xmzy) + 1
    xmzy.strname = Text1(0): xmzy.strno = Text1(1): xmzy.mtime = Time
    Put #1, record_no, xmzy
    Close #1
    Form2.Show
    Unload Me
End Sub
    
'##################################################################
'## 过程名称:Form_Initialize
'## 参数: 无
'##################################################################
Private Sub Form_Initialize()
    mpath = App.Path
    If Right(mpath, 1) <> "\" Then mpath = mpath & "\"
    Open mpath + "xm.dat" For Random As #1 Len = Len(xmzy)
    record_no = LOF(1) / Len(xmzy)
    If record_no > 0 Then
        Get #1, record_no, xmzy
        Text1(0) = xmzy.strname: Text1(1) = xmzy.strno
    End If
    Close #1
    
End Sub
    

⌨️ 快捷键说明

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