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

📄 main.frm

📁 用VB做的一个数据库管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#1.1#0"; "COMCT232.OCX"
Begin VB.Form Main 
   AutoRedraw      =   -1  'True
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "仓库参数配置"
   ClientHeight    =   2505
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6885
   Icon            =   "Main.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   2505
   ScaleWidth      =   6885
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "放弃返回(&C)"
      Height          =   420
      Left            =   5190
      TabIndex        =   3
      Top             =   765
      Width           =   1440
   End
   Begin VB.CommandButton Command1 
      Caption         =   "保存设置(S)"
      Enabled         =   0   'False
      Height          =   420
      Left            =   5190
      TabIndex        =   2
      Top             =   285
      Width           =   1440
   End
   Begin VB.Frame Frame1 
      Caption         =   "报警数量"
      Height          =   1890
      Left            =   300
      TabIndex        =   4
      Top             =   270
      Width           =   2250
      Begin VB.CheckBox Check1 
         Caption         =   "启动时显示"
         Height          =   330
         Left            =   390
         TabIndex        =   1
         Top             =   1395
         Width           =   1365
      End
      Begin ComCtl2.UpDown UpDown1 
         Height          =   315
         Left            =   1410
         TabIndex        =   6
         Top             =   885
         Width           =   270
         _ExtentX        =   476
         _ExtentY        =   556
         _Version        =   327681
         Value           =   1000
         AutoBuddy       =   -1  'True
         BuddyControl    =   "Text1"
         BuddyDispid     =   196613
         OrigLeft        =   1695
         OrigTop         =   915
         OrigRight       =   1965
         OrigBottom      =   1245
         Increment       =   10
         Max             =   20000
         Min             =   10
         SyncBuddy       =   -1  'True
         BuddyProperty   =   0
         Enabled         =   -1  'True
      End
      Begin VB.TextBox Text1 
         Height          =   285
         Left            =   405
         MaxLength       =   5
         TabIndex        =   0
         Text            =   "10"
         Top             =   900
         Width           =   1050
      End
      Begin VB.Label Label1 
         Caption         =   "当产品数量低于下面数量时,自动报警!"
         ForeColor       =   &H00808000&
         Height          =   570
         Left            =   390
         TabIndex        =   5
         Top             =   360
         Width           =   1665
      End
   End
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   285
      Left            =   -1065
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   -300
      Width           =   1140
   End
   Begin VB.Image Image1 
      Height          =   1845
      Left            =   2685
      Picture         =   "Main.frx":08CA
      Stretch         =   -1  'True
      Top             =   210
      Width           =   2145
   End
End
Attribute VB_Name = "Main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
 On Error GoTo NoValible
 Dim InNum As Integer, TempFile As String, TempStr As String
 TempFile = Browser + "ALERT.YSL"
 InNum = FreeFile
 Open TempFile For Output As #InNum
   TempStr = Text1.Text
  Print #InNum, TempStr
   If Check1.Value = 0 Then
      TempStr = "启动时不显示"
      Else
      TempStr = "启动时显示"
   End If
  Print #InNum, TempStr
  Close #InNum
  Unload Me
  Exit Sub
NoValible:
  MsgBox "报警配置文件没有找到!", vbOKOnly + 16, "警告!"
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Main.Left = (MDIForm1.Width - Main.Width) / 2
Main.Top = (MDIForm1.Height - Main.Height) / 2 - 1000
 On Error GoTo NoValible
 Dim InNum As Integer, TempFile As String, TempStr As String
 TempFile = Browser + "ALERT.YSL"
 InNum = FreeFile
 Open TempFile For Input As #InNum
 Line Input #InNum, TempStr
 Line Input #InNum, TempFile
 Close #InNum
 Text1.Text = Trim(TempStr)
If Trim(TempFile) = "启动时显示" Then
 Check1.Value = Checked
 Else
 Check1.Value = 0
End If

  Exit Sub
NoValible:
  MsgBox "报警配置文件没有找到!", vbOKOnly + 16, "警告!"

End Sub

Private Sub Text1_Change()
If Val(Text1.Text) > 0 Then
   Command1.Enabled = True
   Else
   Command1.Enabled = False
End If

End Sub

Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If NumberTrue(KeyAscii, Text1) = False Then
   KeyAscii = 0
End If
End Sub
Function NumberTrue(keyNumber As Integer, NumberStr As TextBox) As Boolean
   '转入退格键时
   If keyNumber = 8 Then
      If Len(Trim(NumberStr.Text)) > 0 Then
      Dim Tstr As String
       Tstr = Left(NumberStr.Text, Len(NumberStr.Text) - 1)
      NumberStr.SelLength = 0
      NumberStr.SelStart = Len(Trim(Tstr)) + 1
      NumberTrue = True
      Exit Function
      End If
      End If
   If keyNumber >= 48 And keyNumber <= 57 Then
       NumberTrue = True
        Else
       NumberTrue = False
   End If
End Function

⌨️ 快捷键说明

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