📄 frmhwbfrc.frm
字号:
VERSION 5.00
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "Vsflex7.ocx"
Begin VB.Form frmHwBfrc
Caption = "货物报废原因"
ClientHeight = 5115
ClientLeft = 1455
ClientTop = 1275
ClientWidth = 8535
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 5115
ScaleWidth = 8535
Begin VB.Frame Frame
Height = 2475
Left = 3000
TabIndex = 0
Top = 30
Width = 5355
Begin VB.CommandButton Command
Caption = "保存(&S)"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 3
Left = 2790
TabIndex = 7
Top = 1590
Width = 1125
End
Begin VB.CommandButton Command
Caption = "新增(&A)"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 150
TabIndex = 6
Top = 1590
Width = 1125
End
Begin VB.CommandButton Command
Caption = "删除(&D)"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 2
Left = 1470
TabIndex = 5
Top = 1590
Width = 1125
End
Begin VB.TextBox Text
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Index = 1
Left = 1470
TabIndex = 2
Top = 315
Width = 3255
End
Begin VB.CheckBox Check
Caption = "停用"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 0
Left = 1470
TabIndex = 1
Top = 870
Width = 1965
End
Begin VB.Label Label
Caption = "报废原因名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 1
Left = 180
TabIndex = 3
Top = 375
Width = 1155
End
End
Begin VSFlex7Ctl.VSFlexGrid Flex
Height = 5025
Index = 0
Left = 30
TabIndex = 4
Top = 30
Width = 2895
_cx = 5106
_cy = 8864
_ConvInfo = 1
Appearance = 1
BorderStyle = 1
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MousePointer = 0
BackColor = -2147483643
ForeColor = -2147483640
BackColorFixed = -2147483633
ForeColorFixed = -2147483630
BackColorSel = -2147483635
ForeColorSel = -2147483634
BackColorBkg = -2147483636
BackColorAlternate= -2147483643
GridColor = -2147483633
GridColorFixed = -2147483632
TreeColor = -2147483632
FloodColor = 192
SheetBorder = -2147483642
FocusRect = 1
HighLight = 1
AllowSelection = -1 'True
AllowBigSelection= -1 'True
AllowUserResizing= 1
SelectionMode = 1
GridLines = 1
GridLinesFixed = 2
GridLineWidth = 1
Rows = 2
Cols = 2
FixedRows = 1
FixedCols = 1
RowHeightMin = 0
RowHeightMax = 0
ColWidthMin = 0
ColWidthMax = 0
ExtendLastCol = 0 'False
FormatString = "|<报废原因"
ScrollTrack = 0 'False
ScrollBars = 3
ScrollTips = 0 'False
MergeCells = 0
MergeCompare = 0
AutoResize = -1 'True
AutoSizeMode = 0
AutoSearch = 0
AutoSearchDelay = 2
MultiTotals = -1 'True
SubtotalPosition= 1
OutlineBar = 0
OutlineCol = 0
Ellipsis = 0
ExplorerBar = 0
PicturesOver = 0 'False
FillStyle = 0
RightToLeft = 0 'False
PictureType = 0
TabBehavior = 0
OwnerDraw = 0
Editable = 0
ShowComboButton = -1 'True
WordWrap = 0 'False
TextStyle = 0
TextStyleFixed = 0
OleDragMode = 0
OleDropMode = 0
DataMode = 0
VirtualData = -1 'True
DataMember = ""
ComboSearch = 3
AutoSizeMouse = -1 'True
FrozenRows = 0
FrozenCols = 0
AllowUserFreezing= 0
BackColorFrozen = 0
ForeColorFrozen = 0
WallPaperAlignment= 9
End
End
Attribute VB_Name = "frmHwBfrc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'QQ:75347626
'MSN:whailin2000@hotmail.com
Option Explicit
Const FlexHwBfRc = 0
Const TxtHwBfRcMc = 1
Const ChkHwBfRcIsStop = 0
Const CmdAdd = 0
Const CmdDel = 2
Const CmdSave = 3
Dim OHwBfRc As HwBfrc
Dim OHwBfRcs As HwBfRcs
Private Sub Command_Click(Index As Integer)
On Error GoTo Errorhandle
Select Case Index
Case CmdAdd
AddRecord
Case CmdDel
Delrecord
Case CmdSave
SaveRecord
End Select
Exit Sub
Errorhandle:
MsgBox Err.Description
End Sub
Private Sub Form_Load()
On Error GoTo Errorhandle
LoadDataIntoGrid
Exit Sub
Errorhandle:
MsgBox Err.Description
End Sub
Private Sub LoadDataIntoGrid()
Dim ItemStr As String
Dim mHwBfRc As HwBfrc
On Error GoTo Errorhandle
Flex(FlexHwBfRc).Rows = 1
Set OHwBfRcs = New HwBfRcs
OHwBfRcs.Fillbydb
For Each mHwBfRc In OHwBfRcs
ItemStr = vbTab & mHwBfRc.HwBfRcMc
Flex(FlexHwBfRc).AddItem ItemStr
Flex(FlexHwBfRc).RowData(Flex(FlexHwBfRc).Rows - 1) = mHwBfRc.HwBfRcKey
Next
If Flex(FlexHwBfRc).Rows > 1 Then
Flex(FlexHwBfRc).Row = 1
Set OHwBfRc = OHwBfRcs(CStr(Flex(FlexHwBfRc).RowData(1)))
SetValueToControl
Else
Set OHwBfRc = Nothing
Clearcontrol
End If
Exit Sub
Errorhandle:
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Private Sub AddRecord()
On Error GoTo Errorhandle
Set OHwBfRc = New HwBfrc
Clearcontrol
Text(TxtHwBfRcMc).SetFocus
Exit Sub
Errorhandle:
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Private Sub Clearcontrol()
On Error GoTo Errorhandle
Text(TxtHwBfRcMc).Text = ""
Check(ChkHwBfRcIsStop).Value = vbUnchecked
Exit Sub
Errorhandle:
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Private Sub SaveRecord()
On Error GoTo Errorhandle
SetValueToObject
If OHwBfRc.HwBfRcId = -1 Then
OHwBfRcs.Add OHwBfRc
ChgGrid "ADD"
Else
OHwBfRc.Save
ChgGrid "CHG"
End If
Exit Sub
Errorhandle:
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Private Sub SetValueToObject()
On Error GoTo Errorhandle
OHwBfRc.HwBfRcMc = Trim(Text(TxtHwBfRcMc).Text)
OHwBfRc.HwBfRcIsStop = Check(ChkHwBfRcIsStop)
Exit Sub
Errorhandle:
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Private Sub ChgGrid(RecordName As String)
Dim ItemStr As String
On Error GoTo Errorhandle
If RecordName = "ADD" Then
ItemStr = vbTab & OHwBfRc.HwBfRcMc
Flex(FlexHwBfRc).AddItem ItemStr
Flex(FlexHwBfRc).RowData(Flex(FlexHwBfRc).Rows - 1) = OHwBfRc.HwBfRcKey
Flex(FlexHwBfRc).Row = Flex(FlexHwBfRc).Rows - 1
Else
Flex(FlexHwBfRc).TextMatrix(Flex(FlexHwBfRc).Row, 1) = Text(TxtHwBfRcMc).Text
End If
Exit Sub
Errorhandle:
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Private Sub Delrecord()
On Error GoTo Errorhandle
If Flex(FlexHwBfRc).Rows = 1 Then
Exit Sub
End If
If MsgBox("您真的要删除吗?", vbYesNo) = vbYes Then
OHwBfRcs.Remove CStr(OHwBfRc.HwBfRcKey)
Flex(FlexHwBfRc).RemoveItem Flex(FlexHwBfRc).Row
If Flex(FlexHwBfRc).Rows = 1 Then
Set OHwBfRc = Nothing
Clearcontrol
Else
Set OHwBfRc = OHwBfRcs(CStr(Flex(FlexHwBfRc).RowData(Flex(FlexHwBfRc).Row)))
SetValueToControl
End If
End If
Exit Sub
Errorhandle:
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Private Sub Flex_RowColChange(Index As Integer)
On Error GoTo Errorhandle
If Flex(FlexHwBfRc).Rows >= 1 Then
Set OHwBfRc = OHwBfRcs(CStr(Flex(FlexHwBfRc).RowData(Flex(FlexHwBfRc).Row)))
SetValueToControl
Else
Set OHwBfRc = Nothing
Clearcontrol
End If
Exit Sub
Errorhandle:
MsgBox Err.Description
End Sub
Private Sub SetValueToControl()
On Error GoTo Errorhandle
Text(TxtHwBfRcMc).Text = OHwBfRc.HwBfRcMc
Check(ChkHwBfRcIsStop).Value = OHwBfRc.HwBfRcIsStop
Exit Sub
Errorhandle:
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Errorhandle
Set OHwBfRc = Nothing
Set OHwBfRcs = Nothing
Exit Sub
Errorhandle:
MsgBox Err.Description
End Sub
Private Sub Form_Resize()
On Error GoTo Errorhandle
Resize_ALL Me
Exit Sub
Errorhandle:
MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -