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

📄 timeconfig.frm

📁 生产计划管理等信息 可以查询计划完成情况等
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form TimeConfig 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "时间设置"
   ClientHeight    =   6255
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   8475
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6255
   ScaleWidth      =   8475
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "保存设置"
      Height          =   375
      Left            =   6960
      TabIndex        =   6
      Top             =   240
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Height          =   300
      Left            =   240
      Picture         =   "TimeConfig.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   885
      Width           =   300
   End
   Begin VB.CommandButton Command5 
      Height          =   300
      Left            =   600
      Picture         =   "TimeConfig.frx":058A
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   885
      Width           =   300
   End
   Begin VB.TextBox txt 
      Appearance      =   0  'Flat
      BorderStyle     =   0  'None
      Height          =   255
      Left            =   3480
      TabIndex        =   3
      Top             =   2205
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   1080
      TabIndex        =   1
      Text            =   "Combo1"
      Top             =   320
      Width           =   1575
   End
   Begin MSFlexGridLib.MSFlexGrid Grid 
      Height          =   4695
      Left            =   240
      TabIndex        =   2
      Top             =   1200
      Width           =   7935
      _ExtentX        =   13996
      _ExtentY        =   8281
      _Version        =   393216
      FixedCols       =   0
      BackColor       =   16777215
      BackColorBkg    =   -2147483633
      GridColor       =   14737632
      GridColorFixed  =   -2147483632
      GridLinesFixed  =   1
      AllowUserResizing=   1
      FormatString    =   ">          起始时间 (HH:MM)|>          时间间隔 (单位:小时)"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Times New Roman"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000010&
      X1              =   240
      X2              =   8280
      Y1              =   765
      Y2              =   765
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "时间方案"
      Height          =   255
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   855
   End
End
Attribute VB_Name = "TimeConfig"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
  LoadTimeConfig Grid, Combo1
End Sub

Private Sub Command2_Click()
  SaveTimeConfig Grid, Combo1.Text
End Sub

Private Sub Command3_Click()
  Grid.Rows = Grid.Rows + 1
End Sub

Private Sub Command5_Click()
  DelTime Combo1, Grid.TextMatrix(Grid.Row, 0)
  Grid.RemoveItem Grid.Row
End Sub

Private Sub Form_Load()
  Me.Left = (Screen.Width - Me.Width) / 2
  Me.Top = (Screen.Height - Me.Height) / 2
  LoadTimeFA Combo1
  
  Grid.ColAlignment(0) = flexAlignCenterCenter
  Grid.ColAlignment(1) = flexAlignCenterCenter
  
  ConvertFont Me
End Sub

Private Sub DelTime(fa As String, Mtime As String)
    SQL = "delete from 休息时间 where 方案='" & fa & "' and 时间起始='" & Mtime & "'"
    If rs.State = 1 Then rs.Close
    rs.Open SQL, DBConn, adOpenKeyset, adLockOptimistic, adCmdText
 '   MsgBox "删除完成", vbInformation, "提示"
End Sub

Private Sub Grid_EnterCell()

    txt.Text = Grid.TextMatrix(Grid.Row, Grid.Col)
    txt.Left = Grid.CellLeft + Grid.Left
    txt.Top = Grid.CellTop + Grid.Top
    txt.Width = Grid.CellWidth
    txt.Height = Grid.CellHeight
    txt.Visible = True

End Sub

Private Sub txt_Change()
    Grid.TextMatrix(Grid.Row, Grid.Col) = txt.Text
End Sub

Private Sub LoadTimeConfig(Flex As MSFlexGrid, fa As String)
      Dim i As Integer
      Dim Mtype As String
      Mtype = Flex.TextMatrix(i, 0)
      SQL = "Select * from 休息时间 where 方案='" & fa & "'"
      If rs.State = 1 Then rs.Close
      rs.Open SQL, DBConn, adOpenKeyset, adLockOptimistic, adCmdText
      If Not rs.EOF Then
         Flex.Rows = rs.RecordCount + 1
         For i = 1 To Flex.Rows - 1
           Flex.TextMatrix(i, 0) = rs.Fields("时间起始").Value
           Flex.TextMatrix(i, 1) = rs.Fields("间隔时间").Value
           rs.MoveNext
         Next i
      Else
         Flex.Rows = 1
      End If
End Sub

Private Sub SaveTimeConfig(Flex As MSFlexGrid, fa As String)
    Dim i As Integer
    For i = 1 To Flex.Rows - 1
      Dim BanZu As String
      BanZu = Flex.TextMatrix(i, 0)
      SQL = "Select * from 休息时间 where 方案='" & fa & "' and 时间起始='" & Flex.TextMatrix(i, 0) & "'"
      Debug.Print SQL
      If rs.State = 1 Then rs.Close
      rs.Open SQL, DBConn, adOpenKeyset, adLockOptimistic, adCmdText
      If rs.EOF Then
         rs.AddNew
         rs.Fields("方案").Value = Combo1.Text
         rs.Fields("时间起始").Value = Flex.TextMatrix(i, 0)
      End If
      rs.Fields("间隔时间").Value = Val(Flex.TextMatrix(i, 1))
      rs.Update
    Next i
    MsgBox "修改完成", vbInformation, "提示"
End Sub


⌨️ 快捷键说明

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