资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:72k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Begin VB.Form XT_BillPrintDesign
- BackColor = &H00E0E0E0&
- Caption = "单据处理"
- ClientHeight = 7200
- ClientLeft = 1515
- ClientTop = 2295
- ClientWidth = 11880
- Icon = "单据打印设置.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form4"
- ScaleHeight = 7200
- ScaleWidth = 11880
- WindowState = 2 'Maximized
- Begin VB.CommandButton Command1
- Caption = "确定"
- Height = 300
- Left = 8100
- TabIndex = 17
- Top = 600
- Width = 795
- End
- Begin VB.ComboBox PrintType
- Height = 300
- Left = 6540
- Style = 2 'Dropdown List
- TabIndex = 16
- Top = 600
- Width = 1350
- End
- Begin VB.PictureBox Pict
- BackColor = &H00FFFFFF&
- BorderStyle = 0 'None
- Height = 6285
- Left = 90
- ScaleHeight = 6285
- ScaleWidth = 10905
- TabIndex = 0
- Top = 930
- Width = 10905
- Begin VSFlex8Ctl.VSFlexGrid WglrGrid
- Height = 4140
- Left = 150
- TabIndex = 19
- Top = 1650
- Width = 10215
- _cx = 18018
- _cy = 7302
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = 12632256
- 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= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 50
- Cols = 10
- FixedRows = 1
- FixedCols = 0
- 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
- 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
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- Begin VSFlex8Ctl.VSFlexGrid HjGrid
- Height = 615
- Left = 450
- TabIndex = 20
- Top = 3000
- Visible = 0 'False
- Width = 6165
- _cx = 10874
- _cy = 1085
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- 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= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 50
- Cols = 10
- 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
- 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
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- End
- Begin VB.PictureBox Text_W
- Appearance = 0 'Flat
- BackColor = &H00C00000&
- ForeColor = &H80000008&
- Height = 75
- Left = 2160
- MousePointer = 9 'Size W E
- ScaleHeight = 45
- ScaleWidth = 45
- TabIndex = 14
- Top = 720
- Visible = 0 'False
- Width = 75
- End
- Begin VB.PictureBox Pict_H
- Appearance = 0 'Flat
- BackColor = &H00FF8080&
- ForeColor = &H80000008&
- Height = 10605
- Left = 10830
- MousePointer = 9 'Size W E
- ScaleHeight = 10575
- ScaleWidth = 30
- TabIndex = 10
- Top = 0
- Width = 65
- End
- Begin VB.PictureBox Pict_W
- Appearance = 0 'Flat
- BackColor = &H00FF8080&
- ForeColor = &H80000008&
- Height = 65
- Left = 0
- MousePointer = 7 'Size N S
- ScaleHeight = 30
- ScaleMode = 0 'User
- ScaleWidth = 10830
- TabIndex = 9
- Top = 6225
- Width = 10860
- End
- Begin VB.PictureBox Grid_W
- Appearance = 0 'Flat
- BackColor = &H00C00000&
- ForeColor = &H80000008&
- Height = 75
- Left = 10290
- MousePointer = 9 'Size W E
- ScaleHeight = 45
- ScaleWidth = 45
- TabIndex = 6
- Top = 3150
- Visible = 0 'False
- Width = 75
- End
- Begin VB.PictureBox Grid_H
- Appearance = 0 'Flat
- BackColor = &H00C00000&
- ForeColor = &H80000008&
- Height = 150
- Left = 2850
- MousePointer = 7 'Size N S
- ScaleHeight = 120
- ScaleWidth = 120
- TabIndex = 5
- Top = 5025
- Visible = 0 'False
- Width = 150
- End
- Begin VB.PictureBox Grid_XY
- Appearance = 0 'Flat
- BackColor = &H00C00000&
- ForeColor = &H80000008&
- Height = 75
- Left = 30
- MousePointer = 5 'Size
- ScaleHeight = 45
- ScaleWidth = 45
- TabIndex = 4
- Top = 2340
- Visible = 0 'False
- Width = 75
- End
- Begin VB.PictureBox label_XY
- BackColor = &H00E0E0E0&
- BorderStyle = 0 'None
- Enabled = 0 'False
- Height = 285
- Left = 1260
- ScaleHeight = 285
- ScaleWidth = 1875
- TabIndex = 7
- Top = 270
- Visible = 0 'False
- Width = 1875
- Begin VB.Label Caption_XY
- BackColor = &H00E0E0E0&
- ForeColor = &H00C00000&
- Height = 225
- Left = 90
- TabIndex = 8
- Top = 45
- Width = 1695
- End
- End
- Begin VB.TextBox LrText
- Appearance = 0 'Flat
- BackColor = &H00FFFFFF&
- BeginProperty Font
- Name = "宋体"
- Size = 7.5
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 225
- Index = 0
- Left = 690
- TabIndex = 1
- Text = "0"
- Top = 1020
- Visible = 0 'False
- Width = 1350
- End
- Begin VB.Label TsLabel
- Alignment = 1 'Right Justify
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "订单号:"
- Height = 180
- Index = 0
- Left = 90
- TabIndex = 3
- Top = 690
- Visible = 0 'False
- Width = 720
- End
- Begin VB.Label Lab_Title
- AutoSize = -1 'True
- BackColor = &H80000018&
- BackStyle = 0 'Transparent
- Caption = "销售订单"
- BeginProperty Font
- Name = "宋体"
- Size = 15
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 300
- Left = 4590
- TabIndex = 2
- Top = 0
- Visible = 0 'False
- Width = 1260
- End
- End
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 555
- Left = 0
- TabIndex = 11
- Top = 0
- Width = 11880
- _ExtentX = 20955
- _ExtentY = 979
- ButtonWidth = 820
- ButtonHeight = 926
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 13
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "竖对"
- Key = "SD"
- ImageIndex = 14
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "横对"
- Key = "HD"
- ImageIndex = 13
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 4
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存"
- Key = "Save"
- ImageIndex = 4
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "刷新"
- Key = "sx"
- ImageIndex = 5
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "表头"
- Key = "Item"
- ImageIndex = 16
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "设置"
- Key = "sz"
- ImageKey = "sz"
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "预览"
- Key = "yl"
- ImageKey = "yl"
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageIndex = 8
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "Exit"
- ImageIndex = 9
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.ImageCombo Imgcbo_SysName
- Height = 315
- Left = 4860
- TabIndex = 15
- Top = 120
- Width = 1575
- _ExtentX = 2778
- _ExtentY = 556
- _Version = 393216
- ForeColor = -2147483640
- BackColor = -2147483643
- OLEDropMode = 1
- Locked = -1 'True
- End
- Begin MSComctlLib.Toolbar GsToolbar
- Height = 525
- Left = 9510
- TabIndex = 13
- Top = 0
- Width = 2475
- _ExtentX = 4366
- _ExtentY = 926
- ButtonWidth = 1455
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 3
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存格式"
- Key = "bcgs"
- ImageKey = "bcgs"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "默认列宽"
- Key = "hfmrgs"
- ImageKey = "mrlk"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "显示项目"
- Key = "szxsxm"
- ImageKey = "xsxm"
- EndProperty
- EndProperty
- End
- Begin VB.ComboBox ComboName
- Height = 300
- Left = 6540
- Style = 2 'Dropdown List
- TabIndex = 12
- Top = 120
- Width = 1305
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 4920
- Top = 0
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 16
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":1042
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":13DC
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":1776
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":1B10
- Key = "xz"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":1EAA
- Key = "xg"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":2244
- Key = "sc"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":25DE
- Key = "sx"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":2978
- Key = "bz"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":2D12
- Key = "tc"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":30AC
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":3446
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":37E0
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":3B7A
- Key = "ht"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":3F14
- Key = "st"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":42AE
- Key = ""
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据打印设置.frx":4648
- Key = "ml"
- EndProperty
- EndProperty
- End
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "打印类型:"
- Height = 180
- Left = 5520
- TabIndex = 18
- Top = 660
- Width = 810
- End
- End
- Attribute VB_Name = "XT_BillPrintDesign"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*********************************************************************************************************
- '* 模 块 名 称 :单据设置
- '* 功 能 描 述 :此功能模块主要完成单据设置
- '* 程序员姓名 :王雄
- '* 最后修改人 :王雄
- '* 最后修改时间:2001/09/10
- '*********************************************************************************************************
- Option Explicit
- '[以下为根据实际情况设置变量
- Dim Bln_BillChange As Boolean '标识单据是否发生改动
- ']
- '以下为固定使用变量(单据)
- ' Dim BillCode As String '单据设计编码(索引号)
- Dim Var_Bill() As Variant '用来返回单据设计信息
- Dim ReportTitle As String '报表主标题
- Dim Tsxx As String '系统提示信息
- '以下为固定使用变量(网格)
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim Pmbcsjhs As Long '屏幕网格保持数据行数(大于等于1)
- Dim Fzxwghs As Integer '辅助项网格行数(包括合计行)
- Dim Sfxshjwg As Boolean '是否显示合计网格
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Sfblbzkd As Boolean '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
- Dim Shsfts As Boolean '删除记录行是否提示
- Dim Szzls As Integer '网格信息数组最大下标值(网格列数-1)
- '以下为固定使用变量(文本框)
- Dim Textvar() As Variant '存储变体型文本框信息
- Dim Textboolean() As Boolean '存储布尔型文本框信息
- Dim Textint() As Integer '存储整型文本框信息
- Dim Textstr() As String '存储字符型文本框信息
- Dim Max_Text_Index As Integer '最大录入文本框索引值
- Dim TextGroupCode As String '文本框录入分组编码
- Dim TextValiJudgeLock() As Boolean '文本框录入有效性判断控制锁
- '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- Dim jsqte As Integer
- Dim TF As Boolean
- Dim Move_Y As Integer
- Dim Move_X As Integer
- Dim Textindex As Integer
- Dim Ssql As String
- Private Sub Combo1_Change()
- End Sub
- Private Sub ComboName_Click()
- If ComboName.ListIndex < 0 Then Exit Sub
- Dim aDo_Printtype As New Recordset
- PrintType.Clear
- Dim aDo_re As New Recordset
- Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where Billname='" & Trim(ComboName.Text) & "'")
- Ssql = "select * from Xt_BillGridPrint where colindex='000' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
- Set aDo_Printtype = Cw_DataEnvi.DataConnect.Execute(Ssql)
- If aDo_Printtype.RecordCount > 0 Then
- Do While Not aDo_Printtype.EOF
- PrintType.AddItem aDo_Printtype!printgridcode
- aDo_Printtype.MoveNext
- PrintType.ListIndex = 0
- Loop
- Else
- aDo_Printtype.Close
- Ssql = "select * from Xt_BillTextPrint where PrintTextCode='default' and text_group_code='" & Trim(aDo_re!text_group_code) & "'"
- Set aDo_Printtype = Cw_DataEnvi.DataConnect.Execute(Ssql)
- If aDo_Printtype.RecordCount > 0 Then
- PrintType.AddItem "default"
- PrintType.ListIndex = 0
- End If
- End If
- End Sub
- Public Sub Command1_Click()
- If Trim(PrintType.Text) = "" Then Exit Sub
- '调入单据信息
- Dim aDo_Name As New Recordset
- Set aDo_Name = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where billname='" & ComboName.Text & "'")
- If aDo_Name.RecordCount > 0 Then
- BillList aDo_Name!BillCode
- Command1.Tag = Trim(aDo_Name!text_group_code)
- PrintType.Tag = PrintType.Text
- XtReportCode = Trim(aDo_Name!Print_code)
- End If
- aDo_Name.Close
- If Dyymctbl Is Nothing Then: Else: Unload Dyymctbl
- Load Dyymctbl
- Text_W.Visible = False
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- Dim jdzygs As Integer
- jdzygs = 7 '在单据录入中,此焦点转移控制值一定小于等于文本框个数,否则网格回车键将不支持.
- Select Case KeyAscii
- Case vbKeyReturn
- If Kjjdzy(jdzygs) Then
- KeyAscii = 0
- End If
- Case 39 '屏蔽字符"'"
- KeyAscii = 0
- End Select
- End Sub
- Private Sub Form_Load() '窗 体 装 入
- Fun_FillUserSystem Imgcbo_SysName, Xtczybm
- End Sub
- Sub BillList(BillCode As String) '初始化单据
- On Error Resume Next
- Dim B As Integer
- For B = 1 To Max_Text_Index
- Unload LrText(B)
- Unload TsLabel(B)
- Next B
- WglrGrid.Visible = True: LrText(0).Visible = True
- TsLabel(0).Visible = True: Lab_Title.Visible = True
- Call Sub_PrintReadBillInfo(BillCode, Me, Var_Bill())
- '以下为文本框处理程序
- TextGroupCode = Var_Bill(2)
- Call PrintDrwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr()) '读入文本框录入信息
- Call Wbkcsh
- XtReportCode = Var_Bill(4)
- Load Dyymctbl
- '<<<<<<<<<<<<<<<<<<<<<<<<<<
- Pict_W.Top = Pict.Height - Pict_W.Height
- Pict_H.Left = Pict.Width - Pict_H.Width
- Pict_W.Width = Pict.Width
- Pict_H.Height = Pict.Height
- Lab_Title.Left = WglrGrid.Width / 2 - Lab_Title.Width / 2 + WglrGrid.Left
- '======================
- Dim aDo_re As New Recordset
- Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_grid where grid_code='" & Trim(Var_Bill(3)) & "'")
- If aDo_re.RecordCount < 1 Then
- WglrGrid.Visible = False: Grid_XY.Visible = False: Grid_H.Visible = False: Grid_W.Visible = False
- aDo_re.Close: GridCode = "": Lab_Title.Left = Pict.Width / 2 - Lab_Title.Width / 2: Exit Sub
- Else
- WglrGrid.Visible = True: aDo_re.Close
- End If
- '======================
- '调入网格并记录一些网格信息
- GridCode = Var_Bill(3) '网格属性编码
- Call PrintBzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Fzxwghs = GridInf(4)
- Sfblbzkd = GridInf(5)
- Shsfts = GridInf(6)
- Sfxshjwg = GridInf(7)
- Szzls = WglrGrid.Cols - 1
- Pmbcsjhs = Int((WglrGrid.Height - WglrGrid.FixedRows * WglrGrid.RowHeight(0)) / Sjhgd) - Fzxwghs - 1
- For jsqte = WglrGrid.FixedRows To WglrGrid.Rows - 1
- WglrGrid.RowHeight(jsqte) = Sjhgd
- Next jsqte
- Sub_AdjustGrid
- '初始化合计网格
- Call Cshhjwg
- '单据变动置为False
- Bln_BillChange = False
- '<<<<<<<<<<<<<<<<<<<<<<<<<<
- Grid_W.Left = WglrGrid.Width + WglrGrid.Left
- Grid_W.Top = WglrGrid.Top + WglrGrid.Height / 2 - 50
- Grid_H.Top = WglrGrid.Height + WglrGrid.Top
- Grid_H.Left = WglrGrid.Left + WglrGrid.Width / 2 - 50
- Grid_XY.Top = WglrGrid.Top
- Grid_XY.Left = WglrGrid.Left - Grid_XY.Width
- Grid_W.Visible = True
- Grid_H.Visible = True
- Grid_XY.Visible = True
- ' Toolbar1.Width = Pict.Width
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '窗体卸载
- '卸载打印页面窗体
- Unload Dyymctbl
- '判断单据是否发生变化,并返回相应标识
- If Bln_BillChange Then
- Xtfhcs = "1"
- Else
- Xtfhcs = "0"
- End If
- End Sub
- '===================以 下 程 序 为 通 用 部 分 ,一 般 不 需 更 改======================='
- Private Sub Sub_AdjustGrid()
- '调 整 网 格
- With WglrGrid
- '加 1 保持一行录入行
- If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
- .Rows = Pmbcsjhs + .FixedRows + Fzxwghs + 1
- For jsqte = .FixedRows To .Rows - 1
- .RowHeight(jsqte) = Sjhgd
- Next jsqte
- Else
- End If
- End With
- End Sub
- Private Sub Cshhjwg() '初始化合计网格(*对合计网格来说,录入网格为容器)
- Dim Lrwglkd As Double
- Dim Hjwgpyl As Integer
- With HjGrid
- If Not Sfxshjwg Then
- .Visible = False
- Exit Sub
- Else
- .Visible = True
- End If
- '设置网格相关属性
- .Enabled = False
- .Appearance = flexFlat
- .BorderStyle = flexBorderNone
- .ScrollBars = flexScrollBarNone
- .Width = WglrGrid.Width
- .FixedRows = 0
- .Rows = 1
- .Cols = WglrGrid.Cols
- .LeftCol = WglrGrid.LeftCol
- .TextMatrix(0, Qslz) = "合 计"
- For jsqte = 0 To WglrGrid.Cols - 1
- .ColHidden(jsqte) = WglrGrid.ColHidden(jsqte)
- .ColWidth(jsqte) = WglrGrid.ColWidth(jsqte)
- .ColAlignment(jsqte) = WglrGrid.ColAlignment(jsqte)
- .ColFormat(jsqte) = WglrGrid.ColFormat(jsqte)
- Next jsqte
- .ColAlignment(Qslz) = flexAlignCenterTop
- For jsqte = .FixedRows To .Rows - 1
- .RowHeight(jsqte) = .Height / .Rows
- Next jsqte
- '程序自动调整网格高度(自动设置为网格剩余高度+辅助项网格行数(默认为1)*数据行高度)、并设置其位置信息
- .Height = Fzxwghs * Sjhgd + ((WglrGrid.Height - WglrGrid.FixedRows * WglrGrid.RowHeight(0)) Mod Sjhgd)
- .RowHeight(0) = .Height
- .Move 0, WglrGrid.Height - .Height, WglrGrid.Width, .Height
- End With
- End Sub
- Private Sub Form_Resize() '窗体大小发生变化时,重新显示文本框
- ' Call Cxxswbk
- End Sub
- 'Private Sub WglrGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long) '网格列发生移动时自动交换网格索引信息
- ' FnBln_RefreshArray Col, Position, GridStr(), GridInf()
- 'End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button) '表格格式设置(通用)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call PrintBcwggs(WglrGrid, GridCode, GridStr())
- Case "hfmrgs" '恢复默认格式
- Call PrintHfmrgs(WglrGrid, GridCode, GridStr())
- Case "szxsxm" '设置显示项目
- Call PrintSzxsxm(WglrGrid, GridCode)
- End Select
- End Sub
- Private Sub Wbkcsh() '录入文本框初始化
- Dim Int_TabIndex As Integer '用来设置文本框TabIndex值
- '文本框TabIndex值由0--N
- LrText(0).TabIndex = 0
- Int_TabIndex = 1
- '最大录入文本框索引值
- Max_Text_Index = Textvar(1)
- ReDim TextValiJudgeLock(Max_Text_Index)
- For jsqte = 0 To Max_Text_Index
- '判断此文本框录入索引号是否存在,如存在则对其进行初始化
- If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
- '自动装入录入文本框和其解释标签
- If jsqte <> 0 Then
- Load LrText(jsqte)
- Load TsLabel(jsqte)
- End If
- '判断录入文本框是否显示
- If Textboolean(jsqte, 4) Then
- LrText(jsqte).Visible = True
- TsLabel(jsqte).Visible = True
- Else
- LrText(jsqte).Visible = False
- TsLabel(jsqte).Visible = False
- End If
- '设置文本框焦点顺序值
- LrText(jsqte).TabIndex = Int_TabIndex
- '文本框TabIndex值+1
- Int_TabIndex = Int_TabIndex + 1
- '初始化其内容
- LrText(jsqte).Text = ""
- LrText(jsqte).Tag = ""
- If Textint(jsqte, 5) <> 0 Then
- LrText(jsqte).MaxLength = Textint(jsqte, 5)
- End If
- '设置文本框位置及大小,并设置相应标签内容及其位置
- LrText(jsqte).Move Textint(jsqte, 13), Textint(jsqte, 12), Textint(jsqte, 11) ' Textint(Jsqte, 10)
- TsLabel(jsqte).Move Textint(jsqte, 13) - TsLabel(jsqte).Width - 20, Textint(jsqte, 12) + (Textint(jsqte, 10) - TsLabel(jsqte).Height) / 2 - 30
- TsLabel(jsqte).Caption = Trim(Textstr(jsqte, 7)) & ":"
- End If
- '将文本框有效性判断进行加锁,在文本框内容发生变化时将锁打开
- TextValiJudgeLock(jsqte) = True
- Next jsqte
- End Sub
- Private Sub Imgcbo_SysName_Click()
- Dim aDo_Name As New Recordset
- ComboName.Clear
- Set aDo_Name = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where system_code='" & Mid(Trim(Imgcbo_SysName.SelectedItem.Key), 2) & "'")
- Do While Not aDo_Name.EOF
- ComboName.AddItem aDo_Name!BillName
- aDo_Name.MoveNext
- Loop
- If aDo_Name.RecordCount > 0 Then ComboName.ListIndex = 0
- aDo_Name.Close
- End Sub
- Private Sub LrText_DblClick(Index As Integer)
- If LrText(Index).BackColor = &HFFFFFF Then
- LrText(Index).BackColor = &HF2FAEB
- Else
- LrText(Index).BackColor = &HFFFFFF
- End If
- End Sub
- Private Sub LrText_GotFocus(Index As Integer)
- Textindex = Index
- Text_W.Left = LrText(Index).Left + LrText(Index).Width
- Text_W.Top = LrText(Index).Top + LrText(Index).Height / 2 - Text_W.Height / 2
- Text_W.Visible = True
- End Sub
- Private Sub PrintType_Click()
- 'Command1_Click
- End Sub
- Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "Save"
- If Trim(Command1.Tag) = "" Then Exit Sub
- Bill_Save
- Case "SD"
- If Trim(Command1.Tag) = "" Then Exit Sub
- SD_Text
- Case "sx"
- If Trim(Command1.Tag) = "" Then Exit Sub
- Command1_Click
- Case "Item"
- If Trim(Command1.Tag) = "" Then Exit Sub
- XT_PrintTItem.Show 1
- Case "HD"
- If Trim(Command1.Tag) = "" Then Exit Sub
- HD_Text
- Case "sz"
- If Trim(Command1.Tag) = "" Then Exit Sub
- Dyymctbl.Show 1
- Case "yl"
- If Trim(Command1.Tag) <> "" Then
- If WglrGrid.Visible = True Then
- BillGridPrint WglrGrid, LrText, GridStr, Szzls, GridCode, TextGroupCode, XtReportCode, False, Trim(PrintType.Tag)
- Else
- BillTextPrint Lab_Title, LrText, TextGroupCode, XtReportCode, False, Trim(PrintType.Tag)
- End If
- End If
- Case "Exit"
- Unload Me
- End Select
- End Sub
- Private Sub Text_W_LostFocus()
- Text_W.Visible = False
- End Sub
- '调整文本框的宽度
- Private Sub Text_W_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = True
- Move_X = X
- label_XY.Top = LrText(Textindex).Top + 200
- label_XY.Left = LrText(Textindex).Left + LrText(Textindex).Width / 2
- Caption_XY.Caption = "TextBox宽度=" & LrText(Textindex).Width
- label_XY.Visible = True
- End Sub
- '调整文本框的宽度
- Private Sub Text_W_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If TF = True Then
- If (LrText(Textindex).Width - (Move_X - X) > 0) And (LrText(Textindex).Width - (Move_X - X) < (Pict.Width - LrText(Textindex).Left - 100)) Then
- label_XY.Top = LrText(Textindex).Top + 200
- label_XY.Left = LrText(Textindex).Left + LrText(Textindex).Width / 2
- '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- LrText(Textindex).Width = LrText(Textindex).Width - (Move_X - X)
- Text_W.Left = LrText(Textindex).Width + LrText(Textindex).Left
- Caption_XY.Caption = "TextBox宽度=" & LrText(Textindex).Width - (Move_X - X)
- End If
- End If
- End Sub
- '调整文本框的宽度
- Private Sub Text_W_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = False
- label_XY.Visible = False
- End Sub
- Private Sub WglrGrid_AfterUserResize(ByVal Row As Long, ByVal Col As Long)
- '调整列宽
- If HjGrid.Visible Then
- With HjGrid
- .ColWidth(Col) = WglrGrid.ColWidth(Col)
- End With
- End If
- End Sub
- Private Sub WglrGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)
- '如果结束列小于用户定义网格开始列,则结束列=用户定义网格开始列
- '因为开始列以前的列都是隐藏列,由于要把当前开始移动列移动到隐藏列上
- '所以控件自动把隐藏列变为显示列,这样在刷新数据时,会把隐藏列上的数据
- '显示出来,并且,由于开始列以前的隐藏列在XT_Grid中,不对应逻辑值,所以在保存
- '网格格式时会出错
- If Col > Position Then
- If Position < GridInf(1) Then Position = GridInf(1)
- Else
- If Col < GridInf(1) Then Col = GridInf(1)
- End If
- Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
- End Sub
- Private Sub WglrGrid_Scroll()
- '限制用户在录入过程中滚动鼠标
- With WglrGrid
- HjGrid.LeftCol = .LeftCol
- End With
- End Sub
- '调整单据的高度
- Private Sub Pict_H_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Move_X = X
- End Sub
- '调整单据的高度
- Private Sub Pict_H_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If (Pict.Width > (Move_X - X)) And (Pict.Width - (Move_X - X) < (Me.Width - Pict.Left - 100)) Then
- Pict.Width = Pict.Width - (Move_X - X)
- Pict_H.Left = Pict.Width - Pict_H.Width
- Pict_W.Width = Pict.Width
- ' If WglrGrid.Visible = False Then
- '/ Lab_Title.Left = Pict.Width / 2 - Lab_Title.Width / 2
- ' End If
- ' Toolbar1.Width = Pict.Width
- End If
- End Sub
- '调整单据的宽度
- Private Sub Pict_W_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Move_Y = Y
- End Sub
- '调整单据的宽度
- Private Sub Pict_W_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If (Pict.Height > (Move_Y - Y)) And ((Pict.Height - (Move_Y - Y) + Pict.Top) < (Me.Height - 500)) Then
- Pict.Height = Pict.Height - (Move_Y - Y)
- Pict_W.Top = Pict.Height - Pict_W.Height
- Pict_H.Height = Pict.Height
- End If
- End Sub
- '调整文本宽的位置
- Private Sub TsLabel_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = True
- Move_Y = Y: Move_X = X
- label_XY.Top = TsLabel(Index).Top + 200
- label_XY.Left = TsLabel(Index).Left + 200
- Caption_XY.Caption = "X=" & TsLabel(Index).Left & ",Y=" & LrText(Index).Top
- label_XY.Visible = True
- End Sub
- '调整文本宽的位置
- Private Sub TsLabel_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- If TF = True Then
- If (TsLabel(Index).Top - (Move_Y - Y) >= 0) And ((TsLabel(Index).Top - (Move_Y - Y)) < (Pict.Height - TsLabel(Index).Height) - 175) Then
- TsLabel(Index).Top = TsLabel(Index).Top - (Move_Y - Y)
- label_XY.Top = label_XY.Top - (Move_Y - Y)
- LrText(Index).Top = TsLabel(Index).Top - 30
- End If
- '------------------------
- If (TsLabel(Index).Left - (Move_X - X) >= 0) And (TsLabel(Index).Left - (Move_X - X) < (Pict.Width - LrText(Index).Width - TsLabel(Index).Width - 75)) Then
- TsLabel(Index).Left = TsLabel(Index).Left - (Move_X - X)
- label_XY.Left = label_XY.Left - (Move_X - X)
- LrText(Index).Left = TsLabel(Index).Left + TsLabel(Index).Width + 20
- End If
- If Textindex = Index Then
- Text_W.Left = LrText(Index).Left + LrText(Index).Width
- Text_W.Top = LrText(Index).Top + LrText(Index).Height / 2 - Text_W.Height / 2
- End If
- Caption_XY.Caption = "X=" & TsLabel(Index).Left & ",Y=" & LrText(Index).Top
- End If
- End Sub
- '调整文本宽的位置
- Private Sub TsLabel_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = False
- label_XY.Visible = False
- End Sub
- '调整网格位置
- Private Sub Grid_XY_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = True
- Move_Y = Y
- Move_X = X
- label_XY.Top = Grid_XY.Top + 200
- label_XY.Left = Grid_XY.Left + 200
- Caption_XY.Caption = "X=" & Grid_XY.Left & ",Y=" & Grid_XY.Top
- label_XY.Visible = True
- End Sub
- '调整网格位置
- Private Sub Grid_XY_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If TF = True Then
- If (Grid_XY.Top - (Move_Y - Y) >= 0) And (Grid_XY.Top - (Move_Y - Y) < Pict.Height - 150) Then
- Grid_XY.Top = Grid_XY.Top - (Move_Y - Y)
- label_XY.Top = label_XY.Top - (Move_Y - Y)
- WglrGrid.Top = Grid_XY.Top
- End If
- If (Grid_XY.Left - (Move_X - X) >= 0) And (Grid_XY.Left - (Move_X - X) < Pict.Width - 200) Then
- Grid_XY.Left = Grid_XY.Left - (Move_X - X)
- label_XY.Left = label_XY.Left - (Move_X - X)
- WglrGrid.Left = Grid_XY.Left + Grid_XY.Width
- End If
- Grid_W.Left = WglrGrid.Width + WglrGrid.Left
- Grid_W.Top = WglrGrid.Top + WglrGrid.Height / 2 - 50
- Grid_H.Top = WglrGrid.Height + WglrGrid.Top
- Grid_H.Left = WglrGrid.Left + WglrGrid.Width / 2 - 50
- Caption_XY.Caption = "X=" & Grid_XY.Left & ",Y=" & Grid_XY.Top
- ' Lab_Title.Left = WglrGrid.Width / 2 - Lab_Title.Width / 2 + WglrGrid.Left
- End If
- End Sub
- '调整网格位置
- Private Sub Grid_XY_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = False
- label_XY.Visible = False
- End Sub
- '改变网格的宽度
- Private Sub Grid_W_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = True
- Move_X = X
- label_XY.Top = Grid_W.Top + 200
- label_XY.Left = Grid_W.Left - label_XY.Width
- Caption_XY.Caption = "网格宽度=" & WglrGrid.Width
- label_XY.Visible = True
- End Sub
- '改变网格的宽度
- Private Sub Grid_W_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If TF = True Then
- If (WglrGrid.Width - (Move_X - X) > 0) And (WglrGrid.Width - (Move_X - X) < (Pict.Width - WglrGrid.Left - 100)) Then
- label_XY.Top = Grid_W.Top + 200
- label_XY.Left = Grid_W.Left - label_XY.Width
- Caption_XY.Caption = "网格宽度=" & WglrGrid.Width - (Move_X - X)
- '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- WglrGrid.Width = WglrGrid.Width - (Move_X - X)
- Grid_W.Left = WglrGrid.Width + WglrGrid.Left
- Grid_W.Top = WglrGrid.Top + WglrGrid.Height / 2 - 50
- Grid_H.Top = WglrGrid.Height + WglrGrid.Top
- Grid_H.Left = WglrGrid.Left + WglrGrid.Width / 2 - 50
- ' Lab_Title.Left = WglrGrid.Width / 2 - Lab_Title.Width / 2 + WglrGrid.Left
- End If
- End If
- End Sub
- '改变网格的宽度
- Private Sub Grid_W_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = False
- label_XY.Visible = False
- End Sub
- '改变网格的高度
- Private Sub Grid_H_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = True
- Move_Y = Y
- label_XY.Top = Grid_H.Top + 200
- label_XY.Left = Grid_H.Left + 200
- Caption_XY.Caption = "网格高度=" & WglrGrid.Height
- label_XY.Visible = True
- End Sub
- '改变网格的高度
- Private Sub Grid_H_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim gridheight As Integer
- If WglrGrid.FixedRows = 1 Then
- gridheight = WglrGrid.RowHeight(1) * 2 + WglrGrid.RowHeight(0)
- Else
- gridheight = WglrGrid.RowHeight(1) + WglrGrid.RowHeight(0) + WglrGrid.RowHeight(2) * 2
- End If
- '<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- If TF = True Then
- If (WglrGrid.Height > Move_Y - Y + gridheight) And ((WglrGrid.Height - (Move_Y - Y) + WglrGrid.Top) < Pict.Height - 130) Then
- label_XY.Top = Grid_H.Top + 200
- label_XY.Left = Grid_H.Left + 200
- Caption_XY.Caption = "网格高度=" & WglrGrid.Height - (Move_Y - Y)
- '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- WglrGrid.Height = WglrGrid.Height - (Move_Y - Y)
- Grid_W.Left = WglrGrid.Width + WglrGrid.Left
- Grid_W.Top = WglrGrid.Top + WglrGrid.Height / 2 - 50
- Grid_H.Top = WglrGrid.Height + WglrGrid.Top
- Grid_H.Left = WglrGrid.Left + WglrGrid.Width / 2 - 50
- End If
- End If
- End Sub
- '改变网格的高度
- Private Sub Grid_H_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- TF = False
- label_XY.Visible = False
- If WglrGrid.Height > (Move_Y - Y) Then
- Pmbcsjhs = Int((WglrGrid.Height - WglrGrid.FixedRows * WglrGrid.RowHeight(0)) / Sjhgd) - Fzxwghs - 1
- WglrGrid.Rows = WglrGrid.FixedRows
- Sub_AdjustGrid
- '程序自动调整网格高度(自动设置为网格剩余高度+辅助项网格行数(默认为1)*数据行高度)、并设置其位置信息
- With HjGrid
- .Height = Fzxwghs * Sjhgd + ((WglrGrid.Height - WglrGrid.FixedRows * WglrGrid.RowHeight(0)) Mod Sjhgd)
- .RowHeight(0) = .Height
- .Move 0, WglrGrid.Height - .Height, WglrGrid.Width, .Height
- End With
- End If
- End Sub
- Private Sub SD_Text() '竖对
- Dim I As Integer: Dim Y As Integer
- For Y = 0 To LrText.Count - 1
- If LrText(Y).BackColor = &HF2FAEB Then
- For I = 1 To LrText.Count - 1
- If LrText(I).BackColor = &HF2FAEB Then
- If LrText(Y).Top > LrText(I).Top Then
- Y = I
- End If
- End If
- Next I
- Exit For
- End If
- Next Y
- For I = 0 To LrText.Count - 1
- If LrText(I).BackColor = &HF2FAEB Then
- LrText(I).Left = LrText(Y).Left
- TsLabel(I).Left = LrText(I).Left - TsLabel(I).Width - 20
- LrText(I).BackColor = &HFFFFFF
- End If
- Next I
- End Sub
- Private Sub HD_Text() '横对
- Dim I As Integer: Dim Y As Integer
- For Y = 0 To LrText.Count - 1
- If LrText(Y).BackColor = &HF2FAEB Then
- For I = 1 To LrText.Count - 1
- If LrText(I).BackColor = &HF2FAEB Then
- If LrText(Y).Top > LrText(I).Top Then
- Y = I
- End If
- End If
- Next I
- Exit For
- End If
- Next Y
- For I = 0 To LrText.Count - 1
- If LrText(I).BackColor = &HF2FAEB Then
- LrText(I).Top = LrText(Y).Top
- TsLabel(I).Top = LrText(I).Top + 30
- LrText(I).BackColor = &HFFFFFF
- End If
- Next I
- End Sub
- Sub Bill_Save() '保存单据信息
- Dim I As Integer, Sql_Str As String
- Dim aDo_Name As New Recordset
- Set aDo_Name = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where billname='" & ComboName.Text & "'")
- For I = 0 To Max_Text_Index
- Sql_Str = "update Xt_BillTextPrint set printTop=" & LrText(I).Top & ",printLeft=" & LrText(I).Left & ",printWidth=" & LrText(I).Width & ",PrintLabelLeft=" & TsLabel(I).Left _
- & " where text_group_code='" & Trim(aDo_Name!text_group_code) & "' and text_index=" & I & " and PrintTextCode='" & PrintType.Text & "'"
- Cw_DataEnvi.DataConnect.Execute Sql_Str
- Next I
- Sql_Str = "update Xt_billgridprint set PrintGridHeight=" & WglrGrid.Height & ",PrintGridWidth=" & WglrGrid.Width _
- & ",PrintGridTop=" & WglrGrid.Top & ",PrintGridLeft=" & WglrGrid.Left & ",PrintDataRows=" & WglrGrid.Rows - WglrGrid.FixedRows _
- & ",BillTitleLeft=" & Lab_Title.Left & ",BillTitleTop=" & Lab_Title.Top _
- & " where Grid_Code='" & Trim(aDo_Name!Grid_code) & "' and ColIndex='000' and PrintGridCode='" & Trim(PrintType.Text) & "'"
- Cw_DataEnvi.DataConnect.Execute Sql_Str
- aDo_Name.Close
- Sql_Str = "update xt_BillDesign set PrintFormHeight=" & Pict.Height & ",PrintFormWidth=" & Pict.Width _
- & " where billname='" & ComboName.Text & "'"
- Cw_DataEnvi.DataConnect.Execute Sql_Str
- End Sub
- '==========================
- '=================
- '=================
- '=================
- '==========================
- Public Sub Sub_PrintReadBillInfo(BillCode As String, Frm_Bill As Form, Var_Bill() As Variant) '读入单据整体设计信息 '读入单据整体信息
- '参数说明:BillCode 单据编码(索引号) Frm_Bill 单据窗体 VarBill 用来返回单据设计信息
- Dim RecTemp As New ADODB.Recordset
- ReDim Var_Bill(1 To 4)
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute("Select * From xt_BillDesign Where BillCode='" & Trim(BillCode) & "'")
- With RecTemp
- If Not .EOF Then
- Frm_Bill.Pict.Height = .Fields("PrintFormHeight") '设置窗体高度
- Frm_Bill.Pict.Width = .Fields("PrintFormWidth") '设置窗体宽度
- Frm_Bill.Lab_Title = Trim(.Fields("BillTitle"))
- Var_Bill(1) = Trim(.Fields("BillName")) '单据描述
- Frm_Bill.Caption = Frm_Bill.Tag & "/" & Var_Bill(1) '单据描述赋予窗体Caption
- Var_Bill(2) = Trim(.Fields("Text_Group_Code")) '单据所使用文本框组索引号
- Var_Bill(3) = Trim(.Fields("Grid_Code")) '单据所使用网格组索引号
- Var_Bill(4) = Trim(.Fields("Print_Code")) '单据所使用网格组索引号
- End If
- End With
- End Sub
- Public Sub PrintDrwbkxx(Wbklrbmte As String, Textvar() As Variant, Textboolean() As Boolean, Textint() As Integer, Textstr() As String) '读入文本框录入信息
- Dim Wbklrbrec As ADODB.Recordset
- Dim Zdszxb As Integer '最大数组下标
- Dim text_indexte As Integer '文本框索引值
- ReDim Textvar(1 To 1)
- Set Wbklrbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM Xt_V_BillTextPrint WHERE text_group_code ='" + Wbklrbmte + "'and PrintTextCode='" & Trim(PrintType.Text) & "' ORDER BY text_index")
- With Wbklrbrec
- If Not (.BOF And .EOF) Then
- .MoveLast
- Zdszxb = .Fields("text_index")
- Textvar(1) = Zdszxb
- ReDim Textboolean(0 To Zdszxb, 1 To 4)
- ReDim Textint(0 To Zdszxb, 1 To 13)
- ReDim Textstr(0 To Zdszxb, 1 To 7)
- .MoveFirst
- Else
- Exit Sub
- End If
- Do While Not .EOF
- text_indexte = .Fields("text_index")
- If .Fields("help_flag") Then '是否提供帮助
- Textboolean(text_indexte, 1) = True
- End If
- If .Fields("Help_ManuFlag") Then '手工设置帮助按钮
- Textboolean(text_indexte, 3) = True
- End If
- If .Fields("YNPrint") Then '文本框是否显示
- Textboolean(text_indexte, 4) = True
- End If
- If Not IsNull(.Fields("text_data_type")) Then '字段数据类型
- Textint(text_indexte, 1) = .Fields("text_data_type")
- End If
- If Not IsNull(.Fields("help_type")) Then '帮助类型
- Textint(text_indexte, 2) = .Fields("help_type")
- End If
- If Not IsNull(.Fields("show_code_name")) Then '帮助返回值显示类型
- Textint(text_indexte, 3) = .Fields("show_code_name")
- End If
- If Not IsNull(.Fields("judge_type")) Then '有效性判断类型
- Textint(text_indexte, 4) = .Fields("judge_type")
- End If
- If Not IsNull(.Fields("text_length")) Then '字段录入长度
- Textint(text_indexte, 5) = .Fields("text_length")
- End If
- If Not IsNull(.Fields("text_int_length")) Then '数值字段整数位长度
- Textint(text_indexte, 6) = .Fields("text_int_length")
- End If
- If Not IsNull(.Fields("text_deci_length")) Then '数值字段小数位长度
- Textint(text_indexte, 7) = .Fields("text_deci_length")
- End If
- If Not IsNull(.Fields("NotAllowEmpty_Type")) Then '字段不允许为空或为零
- Textint(text_indexte, 8) = .Fields("NotAllowEmpty_Type")
- End If
- If Not IsNull(.Fields("Judge_Time")) Then '文本框有效性判断时刻
- Textint(text_indexte, 9) = .Fields("Judge_Time")
- End If
- If Not IsNull(.Fields("TextHeight")) Then '文本框高度
- Textint(text_indexte, 10) = .Fields("TextHeight")
- End If
- If Not IsNull(.Fields("PrintWidth")) Then '文本框宽度
- Textint(text_indexte, 11) = .Fields("PrintWidth")
- End If
- If Not IsNull(.Fields("PrintTop")) Then '文本框距离顶端高度
- Textint(text_indexte, 12) = .Fields("PrintTop")
- End If
- If Not IsNull(.Fields("PrintLeft")) Then '文本框左端距离
- Textint(text_indexte, 13) = .Fields("PrintLeft")
- End If
- Textstr(text_indexte, 1) = Trim(.Fields("text_index") & "") '文本框对应索引值
- Textstr(text_indexte, 2) = Trim(.Fields("text_field_code") & "") '文本框对应编码字段
- Textstr(text_indexte, 3) = Trim(.Fields("text_field_name") & "") '文本框对应名称字段
- Textstr(text_indexte, 4) = Trim(.Fields("help_code") & "") '通用帮助编码
- Textstr(text_indexte, 5) = Trim(.Fields("judge_base") & "") '字段有效性判断依据
- Textstr(text_indexte, 6) = Trim(.Fields("error_message") & "") '字段录入错误提示信息
- Textstr(text_indexte, 7) = Trim(.Fields("text_name") & "") '文本框名称
- .MoveNext
- Loop
- End With
- End Sub
- Public Sub PrintBzWgcsh(Xsgrid As Object, Wgdmte As String, GridInf() As Variant, GridBoolean() As Boolean, GridInt() As Integer, GridStr() As String) '标准网格初始化模块
- '过程参数为:Xsgrid 生成网格对象名称,Wgdmte 网格参数编码,GridInf()返回网格设置信息(返回整体信息)
- 'GridBoolean() 网格列属性(返回布尔型信息),GridInt() 网格列属性(返回整型信息),GridStr() 网格列属性(返回字符型信息)
- Dim Rowjsq As Integer
- Dim Coljsq As Integer
- Dim Qslzte As Integer
- Dim wglbt() As String '网格显示列标题
- Dim Wgxsls As Long '网格显示(主操作)列数
- Dim gdls As Long '网格固定列数
- Dim Gdhs As Long '网格固定行数(标题行数)
- Dim Gdhgd As Double '网格固定行高度
- Dim wglkd() As Double '每列默认字符个数
- Dim wglzz() As Integer '网格列组织形式
- Dim zdxsgs() As String '数值字段显示格式
- Dim Sfhide() As Boolean '网格列是否隐藏
- Dim Sfhxz As Boolean '网格列是否行选中
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim Wglsfkydpx As Integer '网格列是否可移动及排序
- Dim wgxsrec As New ADODB.Recordset '网格显示动态集
- ReDim GridInf(1 To 7) '整个网格设置信息
- Set wgxsrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM Xt_V_BillGridPrint WHERE Grid_Code ='" + Wgdmte + "' and PrintGridCode='" & Trim(PrintType.Text) & "' ORDER BY ColId")
- With wgxsrec
- If .EOF And .BOF Then
- Exit Sub
- Else
- .MoveFirst
- End If
- '如果网格为单据则设置网格大小、位置
- ' If .Fields("BillFlag") Then
- Xsgrid.Height = .Fields("PrintGridHeight") '网格高度
- Xsgrid.Width = .Fields("PrintGridwidth") '网格宽度
- Xsgrid.Top = .Fields("PrintGridTop") '网格上边距
- Xsgrid.Left = .Fields("PrintGridLeft") '网格左边距
- Lab_Title.Top = .Fields("BillTitleTop")
- Lab_Title.Left = .Fields("BillTitleLeft")
- 'End If
- Qslz = .Fields("BeginCol") '网格隐藏(非操作显示)列数
- Sjhgd = .Fields("DataRowHeight") '网格数据行高度
- GridInf(1) = Qslz '起始列值
- GridInf(2) = Sjhgd '数据行高度
- GridInf(3) = .Fields("KeepDataRows") '屏幕保持数据行数
- GridInf(4) = .Fields("AssistantRows") '辅助项网格行数(例如:合计行)
- If .Fields("SaveHelpWidth_Flag") Then '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
- GridInf(5) = True
- Else
- GridInf(5) = False
- End If
- If .Fields("DeleteRowAsk_Flag") Then '删除有效记录行是否提示
- GridInf(6) = True
- Else
- GridInf(6) = False
- End If
- If .Fields("ShowSumGrid_Flag") Then '是否显示合计网格
- GridInf(7) = True
- Else
- GridInf(7) = False
- End If
- Wgxsls = .RecordCount - 1 '网格显示(主操作)列数(原.Fields("wgxsls"))
- gdls = .Fields("FixCols") '网格固定列数
- Gdhs = .Fields("FixRows") '网格固定行数(标题行数)
- Gdhgd = .Fields("FixRowHeight") '网格固定行高度
- Wglsfkydpx = .Fields("explorerbar") '网格列是否可移动及排序
- If .Fields("SelectRow_Flag") Then '是否行选中
- Sfhxz = True
- End If
- ReDim wglbt(Gdhs - 1, Wgxsls + Qslz - 1) '网格显示列标题
- ReDim wglkd(Qslz + Wgxsls - 1) '每列默认字符个数
- ReDim zdxsgs(Qslz + Wgxsls - 1) '数值字段标志
- ReDim wglzz(Qslz + Wgxsls - 1) '网格列组织形式
- ReDim Sfhide(Qslz + Wgxsls - 1) '网格列是否显示
- ReDim GridBoolean(Qslz + Wgxsls - 1, 1 To 6) '网格列属性(布尔型)
- ReDim GridStr(Qslz + Wgxsls - 1, 1 To 20) '网格列信息(字符型)
- ReDim GridInt(Qslz + Wgxsls - 1, 1 To 7) '网格列信息(整型)
- .MoveNext
- jsqte = 0
- Do While Not .EOF
- wglkd(Qslz + jsqte) = .Fields("printColWidth") '网格列宽度限制
- If Not IsNull(.Fields("ColTitle1")) Then
- wglbt(0, Qslz + jsqte) = Trim(.Fields("ColTitle1")) '网格列标题1
- End If
- If Not IsNull(.Fields("ColTitle2")) And Gdhs >= 2 Then '网格列标题2
- wglbt(1, Qslz + jsqte) = Trim(.Fields("ColTitle2"))
- End If
- If Not IsNull(.Fields("ColTitle3")) And Gdhs >= 3 Then '网格列标题3
- wglbt(2, Qslz + jsqte) = Trim(.Fields("ColTitle3"))
- End If
- If .Fields("ColFormat") Then '字段显示格式(千分符)
- If .Fields("Text_Int_Length") <> 0 Then
- zdxsgs(Qslz + jsqte) = "#,##0." + String(.Fields("Text_deci_Length"), "0")
- Else
- zdxsgs(Qslz + jsqte) = "#,##0.00"
- End If
- Select Case .Fields("Text_Data_Type")
- Case 8 '金额
- zdxsgs(Qslz + jsqte) = "#,##0." + String(Xtjexsws, "0")
- Case 9 '数量
- zdxsgs(Qslz + jsqte) = "#,##0." + String(Xtslxsws, "0")
- Case 10 '单价
- zdxsgs(Qslz + jsqte) = "#,##0." + String(Xtdjxsws, "0")
- End Select
- Else
- If .Fields("Text_Int_Length") <> 0 Then
- zdxsgs(Qslz + jsqte) = "##0." + String(.Fields("Text_deci_Length"), "0")
- End If
- End If
- wglzz(Qslz + jsqte) = .Fields("ColAlignment") '网格列组织形式
- ' If .Fields("ColHidden") Then '网格列是否隐藏
- If .Fields("YNPrint") Then
- Sfhide(Qslz + jsqte) = True
- End If
- If .Fields("Edit_Flag") Then '网格列是否可编辑
- GridBoolean(Qslz + jsqte, 1) = True
- End If
- If .Fields("Help_Flag") Then '网格列是否提供帮助
- GridBoolean(Qslz + jsqte, 2) = True
- End If
- If .Fields("Combo_Flag") Then '网格列是否列表框录入
- GridBoolean(Qslz + jsqte, 3) = True
- End If
- If .Fields("ColSum_Flag") Then '网格列是否合计
- GridBoolean(Qslz + jsqte, 4) = True
- End If
- If .Fields("Zero_Empty_Flag") Then '网格内容为零是否清空
- GridBoolean(Qslz + jsqte, 5) = True
- End If
- If .Fields("BooleanFlag") Then '网格列是否为布尔型
- GridBoolean(Qslz + jsqte, 6) = True
- End If
- If Not IsNull(.Fields("Text_Data_Type")) Then '字段数据类型
- GridInt(Qslz + jsqte, 1) = .Fields("Text_Data_Type")
- End If
- If Not IsNull(.Fields("Text_Length")) Then '字段录入长度
- GridInt(Qslz + jsqte, 2) = .Fields("Text_Length")
- End If
- If Not IsNull(.Fields("Text_Int_Length")) Then '字段整数位长度
- GridInt(Qslz + jsqte, 3) = .Fields("Text_Int_Length")
- End If
- If Not IsNull(.Fields("Text_Deci_Length")) Then '字段小数位长度
- GridInt(Qslz + jsqte, 4) = .Fields("Text_Deci_Length")
- End If
- If Not IsNull(.Fields("NotAllowEmpty_Type")) Then '字段不允许为空或为零
- GridInt(Qslz + jsqte, 5) = .Fields("NotAllowEmpty_Type")
- End If
- If Not IsNull(.Fields("Help_Type")) Then '帮助类型
- GridInt(Qslz + jsqte, 6) = .Fields("Help_Type")
- End If
- If Not IsNull(.Fields("HelpReturnValue")) Then '帮助返回值(0-显示返回编码 1-显示返回名称)
- GridInt(Qslz + jsqte, 7) = .Fields("HelpReturnValue")
- End If
- GridStr(Qslz + jsqte, 1) = Trim(.Fields("ColIndex") & "") '网格列索引值
- GridStr(Qslz + jsqte, 2) = Trim(.Fields("EmptyMessage") & "") '字段为空提示信息
- GridStr(Qslz + jsqte, 3) = Trim(.Fields("Help_Code") & "") '通用帮助编码
- GridStr(Qslz + jsqte, 4) = Trim(.Fields("FieldsName") & "") '连接字段(通用帮助)
- GridStr(Qslz + jsqte, 5) = Trim(.Fields("Combo_Code") & "") '列表框编码
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End With
- '网格列组织形式
- With Xsgrid
- .BackColorFixed = &H8000000F '固定行背景色
- .FixedRows = Gdhs '固定行数
- .Rows = Gdhs
- .Cols = Qslz + Wgxsls
- .FixedCols = gdls '固定列数
- .AllowUserResizing = flexResizeBoth
- .MergeCells = flexMergeFixedOnly '合并单元形式
- If Sfhxz Then
- .SelectionMode = flexSelectionByRow
- Else
- .FocusRect = flexFocusHeavy
- .ForeColorSel = &H80000008
- .BackColorSel = &H80000005
- End If
- .ExplorerBar = Wglsfkydpx '网格列是否可移动及排序
- .ScrollTips = True
- .WordWrap = True
- '填 充 网 格 标 题
- For Rowjsq = 0 To .FixedRows - 1
- .MergeRow(Rowjsq) = True
- .RowHeight(Rowjsq) = Gdhgd
- For Coljsq = Qslzte To .Cols - 1
- .TextMatrix(Rowjsq, Coljsq) = wglbt(Rowjsq, Coljsq)
- Next Coljsq
- Next Rowjsq
- '数 据 网 格 高 度
- For Rowjsq = .FixedRows To .Rows - 1
- .RowHeight(Rowjsq) = Sjhgd
- Next Rowjsq
- '定 义 录 入 字 段 属 性
- For Coljsq = 0 To .Cols - 1
- If Coljsq < Qslz Or Sfhide(Coljsq) Then
- .ColHidden(Coljsq) = True
- Else
- .ColHidden(Coljsq) = False
- End If
- .MergeCol(Coljsq) = True
- .ColWidth(Coljsq) = wglkd(Coljsq)
- .ColAlignment(Coljsq) = wglzz(Coljsq)
- If Len(zdxsgs(Coljsq)) <> 0 Then
- .ColFormat(Coljsq) = zdxsgs(Coljsq)
- End If
- If GridBoolean(Coljsq, 6) Then
- .ColDataType(Coljsq) = flexDTBoolean
- End If
- .FixedAlignment(Coljsq) = 4
- Next Coljsq
- End With
- End Sub
- Public Sub PrintSzxsxm(SzgsGrid As Object, Wggsdm As String) '设置网格显示项目
- '过程参数:调整显示项目网格对象,网格格式代码(网格参数)
- Xtcdcs = Wggsdm
- XT_PrintBgxsxmszFrm.Show 1 '调整网格显示项目
- Command1_Click '重新定义网格显示
- End Sub
- Public Sub PrintHfmrgs(Bcgsgrid As Object, Wggsdm As String, GridStr() As String) '恢复网格默认列宽
- '过程参数:保存格式网格对象,网格格式代码(网格参数),GridStr() 从中取网格列索引信息
- Dim RecTemp As New ADODB.Recordset '临时使用动态集
- Dim Qslzte As Integer '起始列值
- Dim Tsxx As String '系统提示信息
- Cw_DataEnvi.DataConnect.BeginTrans
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from xt_v_billgridprint where Grid_Code='" + Trim(Wggsdm) + "' and printgridcode='" & Trim(PrintType.Tag) & "'order by ColId", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- On Error GoTo Swcwcl
- With RecTemp
- If Not .EOF Then
- Qslzte = .Fields("BeginCol")
- .MoveNext
- End If
- Do While Not .EOF
- For jsqte = Qslzte To Bcgsgrid.Cols - 1
- If Trim(.Fields("ColIndex")) = Trim(GridStr(jsqte, 1)) Then
- Exit For
- End If
- Next jsqte
- If jsqte <= Bcgsgrid.Cols - 1 Then
- Bcgsgrid.ColWidth(jsqte) = .Fields("DefaultColWidth")
- .Fields("printColWidth") = .Fields("DefaultColWidth") + 0
- .Update
- End If
- .MoveNext
- Loop
- End With
- Cw_DataEnvi.DataConnect.CommitTrans
- Exit Sub
- Swcwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- Tsxx = "恢复过程中出现未知错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End Sub
- Public Sub PrintBcwggs(Bcgsgrid As Object, Wggsdm As String, GridStr() As String) '保存网格格式(包括网格列宽,网格列顺序)
- '过程参数:Bcgsgrid 保存格式网格对象,Wggsdm 网格格式代码(网格参数),GridStr() 从中取网格列索引信息
- Dim RecTemp As New ADODB.Recordset '临时使用动态集
- Dim Qslzte As Integer '起始列值
- Dim Tsxx As String '系统信息提示
- Cw_DataEnvi.DataConnect.BeginTrans
- On Error GoTo Swcwcl
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from xt_V_billgridprint where Grid_Code='" + Trim(Wggsdm) + "' and printgridcode='" & Trim(PrintType.Tag) & "' order by ColId", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- With RecTemp
- If Not .EOF Then
- Qslzte = .Fields("BeginCol")
- .MoveNext
- End If
- Do While Not .EOF
- For jsqte = Qslzte To Bcgsgrid.Cols - 1
- If Trim(.Fields("ColIndex")) = Trim(GridStr(jsqte, 1)) Then
- Exit For
- End If
- Next jsqte
- If jsqte <= Bcgsgrid.Cols - 1 Then
- .Fields("ColId") = jsqte - Qslzte + 1
- .Fields("printColWidth") = Bcgsgrid.ColWidth(jsqte)
- .Update
- End If
- .MoveNext
- Loop
- End With
- Cw_DataEnvi.DataConnect.CommitTrans
- Tsxx = "表格格式保存完毕!"
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- Swcwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End Sub