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

📄 frmcmp.frm

📁 用VB6.0编写的关于车辆运输调度的系统
💻 FRM
字号:
VERSION 5.00
Object = "{B02F3647-766B-11CE-AF28-C3A2FBE76A13}#2.5#0"; "SS32X25.OCX"
Begin VB.Form frmCmp 
   Caption         =   "Company Info Maintenance"
   ClientHeight    =   7455
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9330
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   7455
   ScaleMode       =   0  'User
   ScaleWidth      =   9500
   WindowState     =   2  'Maximized
   Begin VB.Frame frminput 
      Height          =   3615
      Left            =   120
      TabIndex        =   2
      Top             =   3720
      Width           =   8895
      Begin VB.TextBox txtfax 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   5640
         MaxLength       =   15
         TabIndex        =   16
         Top             =   3000
         Width           =   1485
      End
      Begin VB.TextBox txttel 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   15
         TabIndex        =   15
         Top             =   3000
         Width           =   1485
      End
      Begin VB.TextBox txtadd3 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   25
         TabIndex        =   14
         Top             =   2400
         Width           =   2535
      End
      Begin VB.TextBox txtadd2 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   25
         TabIndex        =   13
         Top             =   1920
         Width           =   2535
      End
      Begin VB.TextBox txtadd1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   25
         TabIndex        =   12
         Top             =   1440
         Width           =   2535
      End
      Begin VB.TextBox txtdesc 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   40
         TabIndex        =   11
         Top             =   840
         Width           =   3960
      End
      Begin VB.TextBox txtcmpc 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   5
         TabIndex        =   10
         Top             =   360
         Width           =   525
      End
      Begin VB.Label Label7 
         Caption         =   "Fax Number:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4560
         TabIndex        =   9
         Top             =   3000
         Width           =   1095
      End
      Begin VB.Label Label6 
         Caption         =   "Tel Number:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   720
         TabIndex        =   8
         Top             =   3000
         Width           =   1095
      End
      Begin VB.Label Label5 
         Caption         =   "Company Address3:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   7
         Top             =   2400
         Width           =   1575
      End
      Begin VB.Label Label4 
         Caption         =   "Company Address2:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   1920
         Width           =   1575
      End
      Begin VB.Label Label3 
         Caption         =   "Company Address1:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   5
         Top             =   1440
         Width           =   1575
      End
      Begin VB.Label Label2 
         Caption         =   "Company Description:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   4
         Top             =   840
         Width           =   1815
      End
      Begin VB.Label Label1 
         Caption         =   "Company Code:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   3
         Top             =   360
         Width           =   1215
      End
   End
   Begin PrjLDS.UserControl1 UserControl1 
      Height          =   615
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   9450
      _ExtentX        =   16669
      _ExtentY        =   1085
   End
   Begin FPSpread.vaSpread vascmp 
      Height          =   2355
      Left            =   120
      TabIndex        =   1
      Top             =   720
      Width           =   8955
      _Version        =   131077
      _ExtentX        =   15796
      _ExtentY        =   4154
      _StockProps     =   64
      EditEnterAction =   5
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      MaxCols         =   1
      MaxRows         =   1
      SpreadDesigner  =   "frmCmp.frx":0000
   End
End
Attribute VB_Name = "frmCmp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit
Dim mkey As String



Private Sub Form_Load()
 
 vascmp.Width = SpreadW
 vascmp.Height = SpreadH
 Call InitToolBar
 Call initspread
 Call vasshow

 End Sub
 
 Private Sub initspread()
 
     With vascmp
            .MaxRows = 0
            .MaxCols = 7 'enuDetailCols.MaxCols
            .ShadowColor = genuBACKCOLOR.CST_Grid_LostFocus
            .Row = -1: .Col = -1
            .BackColor = genuBACKCOLOR.CST_Grid_LostFocus
            .GridColor = vbBlack
     End With
    
     Call SetSpreadHead
     lockspread vascmp, True
                
 End Sub

Private Sub SetSpreadHead()

    SetColHead vascmp, 1, "Company Code", 12
    SetColHead vascmp, 2, "Company Description", 18
    SetColHead vascmp, 3, "Company Add1", 16
    SetColHead vascmp, 4, "Company Add2", 16
    SetColHead vascmp, 5, "Company Add3", 16
    SetColHead vascmp, 6, "Tel Number", 16
    SetColHead vascmp, 7, "Fax Number", 16
End Sub

Private Sub vasshow()
Dim rstcmp As Recordset
Dim sSQL As String
Dim lrow As Integer
    
    sSQL = "select * from syscmp"
    Set rstcmp = Acs_cnt.Execute(sSQL)
    vascmp.MaxRows = 1
    lrow = 1
    SetValue vascmp, lrow, 1, rstcmp!cmpcode
    SetValue vascmp, lrow, 2, rstcmp!cmpdesc
    SetValue vascmp, lrow, 3, rstcmp!Addres1
    SetValue vascmp, lrow, 4, "" & rstcmp!Addres2
    SetValue vascmp, lrow, 5, "" & rstcmp!Addres3
    SetValue vascmp, lrow, 6, rstcmp!telnum
    SetValue vascmp, lrow, 7, rstcmp!faxnum
    
    txtcmpc.Text = GetValue(vascmp, lrow, 1)
    txtdesc.Text = GetValue(vascmp, lrow, 2)
    txtadd1.Text = GetValue(vascmp, lrow, 3)
    txtadd2.Text = GetValue(vascmp, lrow, 4)
    txtadd3.Text = GetValue(vascmp, lrow, 5)
    txttel.Text = GetValue(vascmp, lrow, 6)
    txtfax.Text = GetValue(vascmp, lrow, 7)
    frminput.Enabled = False
    rstcmp.Close
    Set rstcmp = Nothing

End Sub

Private Sub InitToolBar()
    With UserControl1
        .DisplayButton "Save", "Save", False, , "Save"
        .DisplayButton "Modify", "Modify", True, , "Modify"
        .DisplayButton "Cancel", "Cancel", False, , "Cancel"
        .DisplayButton "Close", "Close", True, , "Close"
    End With

End Sub

Private Sub SetToolBar(ByVal mkey As String)
       On Error Resume Next
        Select Case mkey
       
        Case "modify"
            With UserControl1
                .DisplayButton "Modify", "Modify", False, , "Modify"
                .DisplayButton "Save", "Save", True, , "Save"
                .DisplayButton "Cancel", "Cancel", True, , "Cancel"
                .DisplayButton "Close", "Close", False, , "Close"
            End With
            vascmp.Enabled = False
            frminput.Enabled = True
            txtcmpc.Enabled = False
            txtdesc.SetFocus
        Case "cancel"
            With UserControl1
                .DisplayButton "Modify", "Modify", True, , "Modify"
                .DisplayButton "Save", "Save", False, , "Save"
                .DisplayButton "Cancel", "Cancel", False, , "Cancel"
                .DisplayButton "Close", "Close", True, , "Close"
            End With
            Call vasshow
              vascmp.Enabled = True
              frminput.Enabled = False
                            
       Case "save"
            With UserControl1
                .DisplayButton "Save", "Save", False, , "Save"
                .DisplayButton "Modify", "Modify", True, , "Modify"
                .DisplayButton "Cancel", "Cancel", False, , "Cancel"
                .DisplayButton "Close", "Close", True, , "Close"
            End With
            vascmp.Enabled = True
            frminput.Enabled = False

        End Select

End Sub





Private Sub UserControl1_ButtonClick(ByVal Button As MSComctlLib.Button)
    On Error Resume Next
     mkey = LCase(Button.Key)
    
    Select Case LCase(Button.Key)
        Case "save"
            Call saveinfo
            Call vasshow
     
        Case "modify"
                           
        Case "close"
            Unload Me
            Exit Sub
            
        Case Else
   End Select
    Call SetToolBar(mkey)
End Sub

Private Sub saveinfo()
Dim sSQL As String
Dim cmpcode, cmpdesc As String
Dim tel, fax As String
Dim add1, add2, add3 As String
  cmpcode = txtcmpc.Text
  cmpdesc = txtdesc.Text
  add1 = txtadd1.Text
  add2 = txtadd2.Text
  add3 = txtadd3.Text
  tel = txttel.Text
  fax = txtfax.Text
  
  sSQL = "update syscmp set cmpdesc = '" & cmpdesc & "',addres1 = '" & add1 & _
            "', addres2 = '" & add2 & "',  addres3 ='" & add3 & "',telnum = '" & tel & "' ,faxnum = '" & fax & "' where cmpcode = '" & cmpcode & "'"
  Acs_cnt.BeginTrans
  Acs_cnt.Execute (sSQL)
  Acs_cnt.CommitTrans
End Sub

⌨️ 快捷键说明

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