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

📄 menu11.frm

📁 给售房作的,但还没有全完成,最好是只看看里面有用的东东就可以了
💻 FRM
字号:
VERSION 5.00
Begin VB.Form winmenu11 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "售房管理  小区设定"
   ClientHeight    =   3405
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6495
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   3405
   ScaleWidth      =   6495
   Begin VB.Frame Frame1 
      Caption         =   "目前已设定小区列表"
      Height          =   3015
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   6135
      Begin VB.ListBox List2 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   2220
         Left            =   3120
         TabIndex        =   7
         Top             =   540
         Width           =   1335
      End
      Begin VB.CommandButton Command3 
         Caption         =   "删  除"
         Height          =   495
         Left            =   4680
         TabIndex        =   6
         ToolTipText     =   "只能删除未作过初始化的小区"
         Top             =   1200
         Width           =   1095
      End
      Begin VB.CommandButton Command2 
         Caption         =   "重命名"
         Height          =   495
         Left            =   4680
         TabIndex        =   3
         ToolTipText     =   "更改小区的名称"
         Top             =   1920
         Width           =   1095
      End
      Begin VB.CommandButton Command1 
         Caption         =   "增  加"
         Height          =   495
         Left            =   4680
         TabIndex        =   2
         ToolTipText     =   "增加一个新的空小区名"
         Top             =   360
         Width           =   1095
      End
      Begin VB.ListBox List1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   2220
         Left            =   120
         TabIndex        =   1
         Top             =   540
         Width           =   3015
      End
      Begin VB.Label Label1 
         BackColor       =   &H80000001&
         BorderStyle     =   1  'Fixed Single
         Caption         =   " 初 始 化"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0000FFFF&
         Height          =   320
         Left            =   3120
         TabIndex        =   5
         Top             =   240
         Width           =   1335
      End
      Begin VB.Label Label56 
         BackColor       =   &H80000001&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "    小  区  列  表 "
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0000FFFF&
         Height          =   320
         Left            =   120
         TabIndex        =   4
         Top             =   240
         Width           =   3015
      End
   End
End
Attribute VB_Name = "winmenu11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim xiaoquk As Database
Dim xiaoqutab As Recordset

Private Sub Command1_Click()
xqname = InputBox("请输入要增加小区的名称(11个汉字):", "金风售房管理系统")
If xqname = "" Then Exit Sub
Set xiaoqutab = xiaoquk.OpenRecordset("select * from xiaoqu  where xname='" + xqname + "'")
If Not xiaoqutab.EOF Then MsgBox "相同的名称已被使用,请更改!", vbOKOnly + vbExclamation, "金风售房管理系统": Exit Sub
xiaoquk.Execute "insert into xiaoqu (xname,sfcsh) values ('" + xqname + "',false)"
List1.AddItem xqname
List2.AddItem "未初始化"
List1.ListIndex = List1.ListCount - 1
List2.ListIndex = List2.ListCount - 1
End Sub

Private Sub Command2_Click()
If List2.Text = "已初始化" Then MsgBox "对不起,初始化过的小区无权重新命名!", vbOKOnly + vbExclamation, "金风售房管理系统": Exit Sub
oldname = List1.Text
oldpos = List1.ListIndex
msage = "设定小区的新名称:"
name:
yname = InputBox(msage, "呼市金风售房管理系统")
If LTrim(RTrim(yname)) = "" Then Exit Sub
Set xiaoqutab = xiaoquk.OpenRecordset("select * from xiaoqu where xname='" + yname + "'")
If Not xiaoqutab.EOF Then
  If xiaoqutab("xname") <> oldname Then msage = "此名称正在使用,请重新输入!": GoTo name:
End If
xiaoquk.Execute "update xiaoqu  set  xname='" + yname + "' where xname='" + oldname + "'"
Set xiaoqutab = xiaoquk.OpenRecordset("xiaoqu")
List1.Clear
List2.Clear
Do Until xiaoqutab.EOF
   List1.AddItem xiaoqutab("xname")
   If xiaoqutab("sfcsh") Then List2.AddItem "已初始化" Else List2.AddItem "未初始化"
   xiaoqutab.MoveNext
Loop
If List1.ListCount > 0 Then List1.ListIndex = 0: List2.ListIndex = 0

End Sub

Private Sub Command3_Click()
If List2.Text = "已初始化" Then MsgBox "对不起,初始化过的小区无权删除!", vbOKOnly + vbExclamation, "金风售房管理系统": Exit Sub
oldpos = List1.ListIndex
yn = MsgBox("是否真要删除" + List1.Text + "?", vbYesNo + vbQuestion, "金风售房管理系统")
If yn = vbNo Then Exit Sub
xiaoquk.Execute "delete * from  xiaoqu where xname='" + List1.Text + "'"
List1.RemoveItem oldpos
List2.RemoveItem oldpos
If List1.ListCount > 0 Then List1.ListIndex = List1.ListCount - 1: List2.ListIndex = List2.ListCount - 1
End Sub




Private Sub Form_Load()
Select Case menuboot.menunum
    Case "menu0"
      winmenu11.Caption = "售房管理  选择小区"
      Frame1.Caption = "请选择您要查看视图的小区"
   Command1.Visible = False
   Command2.Visible = False
   Command3.Visible = False
   Command4.Visible = True
   Command5.Visible = True
End Select
Set xiaoquk = OpenDatabase(App.Path + "\sfgl.mdb")
Set xiaoqutab = xiaoquk.OpenRecordset("xiaoqu")
List1.Clear
List2.Clear
Do Until xiaoqutab.EOF
   List1.AddItem xiaoqutab("xname")
   If xiaoqutab("sfcsh") Then List2.AddItem "已初始化" Else List2.AddItem "未初始化"
   xiaoqutab.MoveNext
Loop
If List1.ListCount > 0 Then List1.ListIndex = 0: List2.ListIndex = 0
End Sub

Private Sub List1_Click()
List2.ListIndex = List1.ListIndex
End Sub

Private Sub List2_Click()
List1.ListIndex = List2.ListIndex
End Sub

⌨️ 快捷键说明

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