📄 frmitemcommsg.frm
字号:
VERSION 5.00
Object = "{9C4B12C2-D5CE-11D1-9ABC-444553540000}#1.0#0"; "GACEDIT.DLL"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{F6125AB1-8AB1-11CE-A77F-08002B2F4E98}#2.0#0"; "MSRDC20.OCX"
Begin VB.Form frmItemComMsg
BorderStyle = 3 'Fixed Dialog
Caption = "商品组件"
ClientHeight = 3615
ClientLeft = 45
ClientTop = 330
ClientWidth = 6030
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3615
ScaleWidth = 6030
ShowInTaskbar = 0 'False
Begin MSRDC.MSRDC DATA1
Height = 375
Left = 4800
Top = 2550
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
_Version = 393216
Options = 0
CursorDriver = 0
BOFAction = 0
EOFAction = 0
RecordsetType = 3
LockType = 3
QueryType = 0
Prompt = 1
Appearance = 1
QueryTimeout = 30
RowsetSize = 100
LoginTimeout = 15
KeysetSize = 0
MaxRows = 0
ErrorThreshold = -1
BatchSize = 15
BackColor = -2147483643
ForeColor = -2147483640
Enabled = -1 'True
ReadOnly = 0 'False
Appearance = -1 'True
DataSourceName = ""
RecordSource = ""
UserName = ""
Password = ""
Connect = ""
LogMessages = ""
Caption = "MSRDC1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin GATLCTRLLibCtl.CalEdit txtInput
Height = 285
Left = 1080
OleObjectBlob = "frmItemComMsg.frx":0000
TabIndex = 5
Top = 360
Width = 1275
End
Begin VB.CommandButton cmdButton
Cancel = -1 'True
Height = 350
Index = 1
Left = 4740
Style = 1 'Graphical
TabIndex = 4
Top = 1110
UseMaskColor = -1 'True
Width = 1100
End
Begin MSFlexGridLib.MSFlexGrid grdCol
Bindings = "frmItemComMsg.frx":0081
Height = 2865
Left = 60
TabIndex = 3
Top = 690
Width = 4605
_ExtentX = 8123
_ExtentY = 5054
_Version = 393216
Cols = 4
FixedCols = 0
BackColorBkg = -2147483643
GridColorFixed = -2147483643
FocusRect = 0
HighLight = 0
GridLines = 0
SelectionMode = 1
AllowUserResizing= 1
FormatString = "商品 |计量单位 |数量"
End
Begin VB.CommandButton cmdButton
Default = -1 'True
Height = 350
Index = 0
Left = 4740
Style = 1 'Graphical
TabIndex = 2
Top = 750
UseMaskColor = -1 'True
Width = 1100
End
Begin VB.Label lblQuantityCaption
Caption = "组件名称:"
Height = 165
Index = 1
Left = 60
TabIndex = 7
Top = 90
Width = 975
End
Begin VB.Label lblQuantityCaption
Caption = "组件数量:"
Height = 195
Index = 0
Left = 60
TabIndex = 6
Top = 420
Width = 975
End
Begin VB.Label lblDS
Caption = " "
Height = 195
Left = 2400
TabIndex = 1
Top = 420
Width = 2265
End
Begin VB.Label lblCaption
Caption = "lblCaption"
Height = 180
Left = 1110
TabIndex = 0
Top = 90
Width = 3570
End
End
Attribute VB_Name = "frmItemComMsg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'
'WXY
'
'1998-07
Const Topconst = 75 '距上边界的高度
Const Leftconst = 50 '距左边界的宽度
Dim clsGrid As Grid
Dim strDSValue As String
Dim DSValue As Double
Dim blnIsOK As Boolean
Dim blnKeyDown As Boolean
Private FormName As Form
Private lngID As Long
Private Sub FieldButton()
cmdButton(0).Move Me.width - 3 * Leftconst - cmdButton(0).width, grdCol.top
cmdButton(1).Move cmdButton(0).Left, cmdButton(0).top + cmdButton(0).Height + Topconst / 2, cmdButton(0).width, cmdButton(0).Height
grdCol.Move lblQuantityCaption(0).Left, grdCol.top, Me.width - cmdButton(0).width - 5 * Leftconst, Me.Height - grdCol.top - 6 * Topconst
grdCol.ColWidth(1) = grdCol.width - grdCol.ColWidth(2) - grdCol.ColWidth(3) - 5 * Screen.TwipsPerPixelX
lblCaption.width = 2 * StrLen(lblCaption.Caption) * Me.FontSize * 10 'grdCol.width - (lblCaption.Left - grdCol.Left)
If txtInput.Visible And txtInput.Enable Then
txtInput.SetFocus
End If
End Sub
Private Sub cmdButton_Click(Index As Integer)
If Index = 0 Then
cmdOK_Click FormName
Else
CmdCancel_Click
End If
End Sub
Private Sub Form_Activate()
SetHelpID C2lng(Me.HelpContextID)
End Sub
Private Sub Form_Load()
Me.HelpContextID = 22002
Set clsGrid = New Grid
Set clsGrid.Grid = grdCol
cmdButton(0).Picture = Utility.GetFormResPicture(1001, 0)
cmdButton(1).Picture = Utility.GetFormResPicture(1002, 0)
Me.Icon = Utility.GetFormResPicture(139, vbResIcon)
txtInput.Text = ""
End Sub
Private Sub Form_Resize()
FieldButton
End Sub
Public Function SetList(ByVal frmName As Form, ByVal lngItemCombinationID As Long) As Boolean
On Error Resume Next
Dim strSql As String
Dim recTmp As rdoResultset
Dim intI As Integer
Set FormName = frmName
lngID = lngItemCombinationID
strSql = "SELECT Item.strItemCode || ' ' || Item.strItemName || ' ' || Item.strItemStyle,ItemUnit.strUnitName,ItemUnit.dblFactor 折算因子 " & _
" FROM Item,ItemCombination,ItemUnit " & _
" WHERE Item.lngItemID=ItemCombination.lngCombinationItemID and ItemCombination.lngCombinationUnitID=ItemUnit.lngUnitID and Item.lngItemID=" & lngItemCombinationID
Set recTmp = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
If recTmp Is Nothing Then
ShowMsg Me.hwnd, "没有此种商品!", MB_ICONQUESTION + MB_DEFBUTTON1 + MB_SYSTEMMODAL, "提示窗口"
Exit Function
End If
If recTmp.BOF And recTmp.EOF Then
ShowMsg Me.hwnd, "没有此种商品!", MB_ICONQUESTION + MB_DEFBUTTON1 + MB_SYSTEMMODAL, "提示窗口"
recTmp.Close
Set recTmp = Nothing
Exit Function
End If
'写标题栏的商品名称
lblCaption.Caption = recTmp.rdoColumns(0).Value
lblDS.Caption = Trim(recTmp.rdoColumns(1).Value)
lblDS.Tag = recTmp.rdoColumns(2).Value
recTmp.Close
grdCol.Row = 0
For intI = 1 To grdCol.Cols - 1
grdCol.ColAlignment(intI) = 4
Next intI
strSql = "SELECT ItemCombination.lngPartItemID PartItemID, Item.strItemCode || ' ' || Item.strItemName || ' ' || Item.strItemStyle 部件名称,ItemUnit.strUnitName 计量单位, ItemCombination.intQuantity 数量, " _
& "ItemUnit.lngUnitID UnitID,ItemUnit.dblFactor 折算因子 " _
& "FROM ItemCombination,ItemUnit,Item " _
& "WHERE ItemCombination.lngPartUnitID = ItemUnit.lngUnitID AND ItemCombination.lngPartItemID = Item.lngItemID AND ItemCombination.lngCombinationItemID=" & lngItemCombinationID
Set recTmp = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
If recTmp Is Nothing Then
ShowMsg Me.hwnd, "没有可参照的部件产品!", MB_ICONQUESTION + MB_DEFBUTTON1 + MB_SYSTEMMODAL, "提示窗口"
Exit Function
End If
If recTmp.BOF And recTmp.EOF Then
ShowMsg Me.hwnd, "没有可参照的部件产品!", MB_ICONQUESTION + MB_DEFBUTTON1 + MB_SYSTEMMODAL, "提示窗口"
recTmp.Close
Set recTmp = Nothing
Exit Function
End If
Set Data1.Resultset = recTmp
If grdCol.Rows > 1 Then
For intI = 1 To grdCol.Rows - 1
grdCol.TextMatrix(intI, 3) = NumberConvert(grdCol.TextMatrix(intI, 3), C2Dbl(grdCol.TextMatrix(intI, 5)), False)
Next intI
End If
grdCol.ColWidth(0) = 0
grdCol.ColWidth(2) = 5 * Me.TextWidth("AD")
grdCol.ColWidth(3) = 5 * Me.TextWidth("AD")
grdCol.ColWidth(4) = 0
grdCol.ColWidth(5) = 0
recTmp.MoveLast
recTmp.MoveFirst
recTmp.Close
Set recTmp = Nothing
clsGrid.SetupStyle
txtInput.Text = ""
'此窗口显示位置定位,在当前单元格的左下角
Me.Left = 8 * Screen.TwipsPerPixelX + FormName.Left + FormName.grdCol.Left + FormName.grdCol.ColPos(1) + FormName.grdCol.ColWidth(1)
Me.top = 116 * Screen.TwipsPerPixelY + FormName.top + FormName.grdCol.top + FormName.grdCol.RowHeight(0) '+ FormName.grdCol.RowPos(FormName.grdCol.Row)
Me.Show 1
SetList = blnIsOK
End Function
Private Sub Form_Unload(Cancel As Integer)
If C2Dbl(txtInput.Text) = 0 Then blnIsOK = False
If blnIsOK = False Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -