transactiondetail.frm
来自「This application i made for handle simpl」· FRM 代码 · 共 264 行
FRM
264 行
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{D18BBD1F-82BB-4385-BED3-E9D31A3E361E}#1.0#0"; "KewlButtonz.ocx"
Begin VB.Form frmTransactionDetail
BackColor = &H00FBF7F4&
BorderStyle = 1 'Fixed Single
Caption = "Transaction"
ClientHeight = 6900
ClientLeft = 45
ClientTop = 330
ClientWidth = 11400
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "TransactionDetail.frx":0000
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 460
ScaleMode = 3 'Pixel
ScaleWidth = 760
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin KewlButtonz.KewlButtons btnClose
Height = 390
Left = 9900
TabIndex = 3
Top = 6150
Width = 1290
_ExtentX = 2275
_ExtentY = 688
BTYPE = 3
TX = "&Close"
ENAB = -1 'True
BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
COLTYPE = 1
FOCUSR = -1 'True
BCOL = 15002603
BCOLO = 15002603
FCOL = 0
FCOLO = 0
MCOL = 12632256
MPTR = 0
MICON = "TransactionDetail.frx":0EBA
UMCOL = -1 'True
SOFT = 0 'False
PICPOS = 0
NGREY = 0 'False
FX = 0
HAND = 0 'False
CHECK = 0 'False
VALUE = 0 'False
End
Begin MSComctlLib.ImageList imgList
Left = 10500
Top = 4950
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 14
MaskColor = 14480885
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "TransactionDetail.frx":0ED6
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.ListView lvDetail
Height = 4590
Left = 225
TabIndex = 0
Top = 1050
Width = 10965
_ExtentX = 19341
_ExtentY = 8096
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
SmallIcons = "imgList"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 0
NumItems = 0
End
Begin Irfan.IrfanHeader ihdForm
Align = 1 'Align Top
Height = 825
Left = 0
Top = 0
Width = 11400
_ExtentX = 20108
_ExtentY = 1455
Text = "Detail"
End
Begin VB.Label lblTotal
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H00F0E0D5&
BorderStyle = 1 'Fixed Single
Caption = "0"
BeginProperty Font
Name = "Verdana"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 315
Index = 0
Left = 7050
TabIndex = 1
Top = 5700
Width = 2040
End
Begin VB.Label lblTotal
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H00F0E0D5&
BorderStyle = 1 'Fixed Single
Caption = "0"
BeginProperty Font
Name = "Verdana"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 315
Index = 1
Left = 9150
TabIndex = 2
Top = 5700
Width = 2040
End
End
Attribute VB_Name = "frmTransactionDetail"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private lx As MSComctlLib.ListItem
Private Sub btnClose_Click()
Call Unload(Me)
End Sub
Private Sub Form_Load()
Call SetHeader
Call TransactionViewDetail(frmTransaction.lvTransaction.SelectedItem.Text)
Call CountList
End Sub
Private Sub TransactionViewDetail(nKode As String)
On Error GoTo NoDetail
Dim i As Integer
i = 1
comm.CommandText = "TransactionViewDetail"
comm.CommandType = CommandTypeEnum.adCmdStoredProc
Call comm.Parameters.Append(comm.CreateParameter("@code", DataTypeEnum.adChar, , 12, nKode))
Call conn.Open
comm.ActiveConnection = conn
Set rs = comm.Execute()
Do While (Not (rs.EOF()))
Set lx = lvDetail.ListItems.Add(, , DigitPrec(CStr(i), 2), , 1)
Call lx.ListSubItems.Add(, , CStr(rs("Uraian")))
Call lx.ListSubItems.Add(, , CStr(rs("IdAccount")))
Call lx.ListSubItems.Add(, , CStr(rs("WorkOrder")))
Call lx.ListSubItems.Add(, , CStr(rs("IdArea")))
Call lx.ListSubItems.Add(, , CStr(Format(rs("Debet"), INTNUMFORMAT)))
Call lx.ListSubItems.Add(, , CStr(Format(rs("Kredit"), INTNUMFORMAT)))
i = i + 1
Call rs.MoveNext
Loop
Call ClearParameter(comm)
Call conn.Close
Exit Sub
NoDetail:
Call CloseConnection(Err)
End Sub
Private Sub SetHeader()
With lvDetail.ColumnHeaders
Call .Add(, , "No", 40)
Call .Add(, , "Uraian", 170)
Call .Add(, , "Kode Account", 100)
Call .Add(, , "WorkOrder", 100)
Call .Add(, , "Kode Area", 80)
Call .Add(, , "Debet", 120, ListColumnAlignmentConstants.lvwColumnRight)
Call .Add(, , "Kredit", 120, ListColumnAlignmentConstants.lvwColumnRight)
End With
End Sub
Private Sub CountList()
Dim i As Integer
Dim nDebet As Currency, nKredit As Currency
nDebet = 0
nKredit = 0
For i = 1 To lvDetail.ListItems.Count
nDebet = nDebet + CCur(lvDetail.ListItems(i).ListSubItems(5).Text)
nKredit = nKredit + CCur(lvDetail.ListItems(i).ListSubItems(6).Text)
Next i
lblTotal(0).Caption = CStr(Format(nDebet, INTNUMFORMAT))
lblTotal(1).Caption = CStr(Format(nKredit, INTNUMFORMAT))
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?