+
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:20k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Begin VB.Form Dev_ItemPlaceInfoForm 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "项目位置设置"
  7.    ClientHeight    =   6375
  8.    ClientLeft      =   1005
  9.    ClientTop       =   990
  10.    ClientWidth     =   9990
  11.    HelpContextID   =   2502008
  12.    Icon            =   "设置_基本信息位置设置.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   6375
  17.    ScaleWidth      =   9990
  18.    Begin TabDlg.SSTab SSTab1 
  19.       Height          =   5610
  20.       Left            =   75
  21.       TabIndex        =   1
  22.       Top             =   675
  23.       Width           =   9840
  24.       _ExtentX        =   17357
  25.       _ExtentY        =   9895
  26.       _Version        =   393216
  27.       Style           =   1
  28.       Tabs            =   1
  29.       TabsPerRow      =   4
  30.       TabHeight       =   520
  31.       MouseIcon       =   "设置_基本信息位置设置.frx":1042
  32.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  33.          Name            =   "宋体"
  34.          Size            =   9
  35.          Charset         =   134
  36.          Weight          =   400
  37.          Underline       =   0   'False
  38.          Italic          =   0   'False
  39.          Strikethrough   =   0   'False
  40.       EndProperty
  41.       TabCaption(0)   =   "基本信息"
  42.       TabPicture(0)   =   "设置_基本信息位置设置.frx":105E
  43.       Tab(0).ControlEnabled=   -1  'True
  44.       Tab(0).Control(0)=   "Label3"
  45.       Tab(0).Control(0).Enabled=   0   'False
  46.       Tab(0).Control(1)=   "Picture1"
  47.       Tab(0).Control(1).Enabled=   0   'False
  48.       Tab(0).Control(2)=   "Text1"
  49.       Tab(0).Control(2).Enabled=   0   'False
  50.       Tab(0).Control(3)=   "Command1"
  51.       Tab(0).Control(3).Enabled=   0   'False
  52.       Tab(0).ControlCount=   4
  53.       Begin VB.CommandButton Command1 
  54.          Height          =   300
  55.          Left            =   4800
  56.          Picture         =   "设置_基本信息位置设置.frx":107A
  57.          Style           =   1  'Graphical
  58.          TabIndex        =   11
  59.          Top             =   0
  60.          Width           =   300
  61.       End
  62.       Begin VB.TextBox Text1 
  63.          Height          =   285
  64.          Left            =   2760
  65.          Locked          =   -1  'True
  66.          TabIndex        =   10
  67.          Top             =   0
  68.          Width           =   2025
  69.       End
  70.       Begin VB.PictureBox Picture1 
  71.          Height          =   5000
  72.          Left            =   180
  73.          ScaleHeight     =   4935
  74.          ScaleWidth      =   9465
  75.          TabIndex        =   2
  76.          Top             =   450
  77.          Width           =   9524
  78.          Begin VB.VScrollBar VS_E 
  79.             Height          =   4965
  80.             LargeChange     =   20
  81.             Left            =   9165
  82.             SmallChange     =   200
  83.             TabIndex        =   8
  84.             Top             =   0
  85.             Width           =   285
  86.          End
  87.          Begin VB.PictureBox Pict 
  88.             BackColor       =   &H00FFFFFF&
  89.             BorderStyle     =   0  'None
  90.             Height          =   9000
  91.             Left            =   0
  92.             ScaleHeight     =   9000
  93.             ScaleMode       =   0  'User
  94.             ScaleWidth      =   9150
  95.             TabIndex        =   3
  96.             Top             =   0
  97.             Width           =   9148
  98.             Begin VB.PictureBox label1 
  99.                Appearance      =   0  'Flat
  100.                BackColor       =   &H80000005&
  101.                BorderStyle     =   0  'None
  102.                Enabled         =   0   'False
  103.                ForeColor       =   &H80000008&
  104.                Height          =   285
  105.                Left            =   1380
  106.                ScaleHeight     =   285
  107.                ScaleWidth      =   1875
  108.                TabIndex        =   5
  109.                Top             =   975
  110.                Visible         =   0   'False
  111.                Width           =   1875
  112.                Begin VB.Label Label2 
  113.                   Appearance      =   0  'Flat
  114.                   BackColor       =   &H80000005&
  115.                   BackStyle       =   0  'Transparent
  116.                   Caption         =   "Label2"
  117.                   ForeColor       =   &H80000008&
  118.                   Height          =   225
  119.                   Left            =   150
  120.                   TabIndex        =   6
  121.                   Top             =   0
  122.                   Width           =   1695
  123.                End
  124.             End
  125.             Begin VB.TextBox Text_T 
  126.                BackColor       =   &H00FFFFFF&
  127.                Height          =   335
  128.                Index           =   0
  129.                Left            =   855
  130.                MaxLength       =   3
  131.                TabIndex        =   4
  132.                Tag             =   "T"
  133.                Top             =   765
  134.                Visible         =   0   'False
  135.                Width           =   1485
  136.             End
  137.             Begin VB.Label T_Label 
  138.                AutoSize        =   -1  'True
  139.                BackColor       =   &H00C0E0FF&
  140.                BackStyle       =   0  'Transparent
  141.                Caption         =   "姓名"
  142.                Height          =   180
  143.                Index           =   0
  144.                Left            =   405
  145.                TabIndex        =   7
  146.                Top             =   810
  147.                Visible         =   0   'False
  148.                Width           =   360
  149.             End
  150.          End
  151.       End
  152.       Begin VB.Label Label3 
  153.          AutoSize        =   -1  'True
  154.          Caption         =   "项目类别:"
  155.          Height          =   180
  156.          Left            =   1860
  157.          TabIndex        =   9
  158.          Top             =   60
  159.          Width           =   810
  160.       End
  161.    End
  162.    Begin MSComctlLib.Toolbar SzToolbar 
  163.       Align           =   1  'Align Top
  164.       Height          =   555
  165.       Left            =   0
  166.       TabIndex        =   0
  167.       Top             =   0
  168.       Width           =   9990
  169.       _ExtentX        =   17621
  170.       _ExtentY        =   979
  171.       ButtonWidth     =   820
  172.       ButtonHeight    =   926
  173.       Appearance      =   1
  174.       Style           =   1
  175.       ImageList       =   "ImageList1"
  176.       _Version        =   393216
  177.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  178.          NumButtons      =   10
  179.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  180.             Caption         =   "竖对"
  181.             Key             =   "SD"
  182.             ImageIndex      =   14
  183.          EndProperty
  184.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  185.             Caption         =   "横对"
  186.             Key             =   "HD"
  187.             ImageIndex      =   13
  188.          EndProperty
  189.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  190.             Style           =   4
  191.          EndProperty
  192.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  193.             Caption         =   "保存"
  194.             Key             =   "Save"
  195.             ImageIndex      =   4
  196.          EndProperty
  197.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  198.             Caption         =   "刷新"
  199.             Key             =   "sx"
  200.             ImageIndex      =   5
  201.          EndProperty
  202.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  203.             Style           =   3
  204.          EndProperty
  205.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  206.             Caption         =   "项目"
  207.             Key             =   "Item"
  208.             ImageIndex      =   16
  209.          EndProperty
  210.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  211.             Style           =   4
  212.          EndProperty
  213.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  214.             Caption         =   "帮助"
  215.             Key             =   "bz"
  216.             ImageIndex      =   8
  217.          EndProperty
  218.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  219.             Caption         =   "退出"
  220.             Key             =   "Exit"
  221.             ImageIndex      =   9
  222.          EndProperty
  223.       EndProperty
  224.       BorderStyle     =   1
  225.       Begin MSComctlLib.ImageList ImageList1 
  226.          Left            =   4320
  227.          Top             =   0
  228.          _ExtentX        =   1005
  229.          _ExtentY        =   1005
  230.          BackColor       =   -2147483643
  231.          ImageWidth      =   16
  232.          ImageHeight     =   16
  233.          MaskColor       =   12632256
  234.          _Version        =   393216
  235.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  236.             NumListImages   =   16
  237.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  238.                Picture         =   "设置_基本信息位置设置.frx":1404
  239.                Key             =   "sz"
  240.             EndProperty
  241.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  242.                Picture         =   "设置_基本信息位置设置.frx":179E
  243.                Key             =   "dy"
  244.             EndProperty
  245.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  246.                Picture         =   "设置_基本信息位置设置.frx":1B38
  247.                Key             =   "yl"
  248.             EndProperty
  249.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  250.                Picture         =   "设置_基本信息位置设置.frx":1ED2
  251.                Key             =   "xz"
  252.             EndProperty
  253.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  254.                Picture         =   "设置_基本信息位置设置.frx":226C
  255.                Key             =   "xg"
  256.             EndProperty
  257.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  258.                Picture         =   "设置_基本信息位置设置.frx":2606
  259.                Key             =   "sc"
  260.             EndProperty
  261.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  262.                Picture         =   "设置_基本信息位置设置.frx":29A0
  263.                Key             =   "sx"
  264.             EndProperty
  265.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  266.                Picture         =   "设置_基本信息位置设置.frx":2D3A
  267.                Key             =   "bz"
  268.             EndProperty
  269.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  270.                Picture         =   "设置_基本信息位置设置.frx":30D4
  271.                Key             =   "tc"
  272.             EndProperty
  273.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  274.                Picture         =   "设置_基本信息位置设置.frx":346E
  275.                Key             =   "bcgs"
  276.             EndProperty
  277.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  278.                Picture         =   "设置_基本信息位置设置.frx":3808
  279.                Key             =   "mrlk"
  280.             EndProperty
  281.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  282.                Picture         =   "设置_基本信息位置设置.frx":3BA2
  283.                Key             =   "xsxm"
  284.             EndProperty
  285.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  286.                Picture         =   "设置_基本信息位置设置.frx":3F3C
  287.                Key             =   "ht"
  288.             EndProperty
  289.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  290.                Picture         =   "设置_基本信息位置设置.frx":42D6
  291.                Key             =   "st"
  292.             EndProperty
  293.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  294.                Picture         =   "设置_基本信息位置设置.frx":4670
  295.                Key             =   ""
  296.             EndProperty
  297.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  298.                Picture         =   "设置_基本信息位置设置.frx":4A0A
  299.                Key             =   "ml"
  300.             EndProperty
  301.          EndProperty
  302.       End
  303.    End
  304. End
  305. Attribute VB_Name = "Dev_ItemPlaceInfoForm"
  306. Attribute VB_GlobalNameSpace = False
  307. Attribute VB_Creatable = False
  308. Attribute VB_PredeclaredId = True
  309. Attribute VB_Exposed = False
  310. Option Explicit
  311. Dim tf As Boolean
  312. Dim Move_Y As Integer
  313. Dim Move_X As Integer
  314. Dim VS_int As Integer
  315. Dim Rows_int As Integer
  316. Dim Ssql_str As String
  317. Dim add_item As New ADODB.Recordset
  318. Dim VsE_TF As Boolean
  319. Private Sub Command1_Click() '选中项目类别
  320.     Dev_ItemDEVSort.Show 1
  321.     If Trim(Dev_ItemDEVSort.Combo1.Tag) <> "" Then
  322.         Command1.Tag = Dev_ItemDEVSort.Combo1.ItemData(Dev_ItemDEVSort.Combo1.ListIndex)
  323.         Text1.Text = Dev_ItemDEVSort.Combo1.Text
  324.         Form_Load
  325.     End If
  326. End Sub
  327. Private Sub Form_Load()
  328.     List
  329. End Sub
  330. Public Sub List() '向界面加载项目信息
  331.     On Error Resume Next
  332.     Dim B As Integer
  333.     VsE_TF = False
  334.     Pict.Top = 0: Pict.Left = 0: VS_E.Value = 0
  335.     VsE_TF = True
  336.     
  337.     For B = 1 To Text_t.Count - 1
  338.         Unload Text_t(B)
  339.         Unload T_Label(B)
  340.     Next B
  341.     '-------------
  342.     Dim i As Integer
  343.     i = 1
  344.     VS_E.Max = 500: VS_int = 0
  345.     If Trim(Command1.Tag) = "" Then Exit Sub
  346.     Set add_item = Cw_DataEnvi.DataConnect.Execute("select * from dev_V_Itemlist  where isid=" & Val(Command1.Tag) & " and YNShow='1' order by tab")
  347.     Rows_int = add_item.RecordCount
  348.     Do While Not add_item.EOF
  349.         Load T_Label(i)
  350.         Load Text_t(i)
  351.         T_Label(i).Left = Val(add_item!itemleft & "")
  352.         T_Label(i).Top = Val(add_item!itemtop & "")
  353.         T_Label(i).Tag = add_item!ItemCode
  354.         T_Label(i).Caption = add_item!ItemChineseName
  355.         Text_t(i).Left = T_Label(i).Left + T_Label(i).Width + 100
  356.         Text_t(i).Top = T_Label(i).Top - 50
  357.         Text_t(i).TabIndex = "" & add_item!Tab - 1
  358.           
  359.         Text_t(i).Width = add_item!ItmeFieldLength * 105
  360.         Text_t(i).Visible = True
  361.         Text_t(i).Text = add_item!Tab
  362.         T_Label(i).Visible = True
  363.         i = i + 1
  364.     add_item.MoveNext
  365.     Loop
  366.     add_item.Close
  367. End Sub
  368. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  369.     Select Case Button.Key
  370.            Case "Save"
  371.                 YesNo_str = MsgBox("您是否保存当前格式?", vbYesNo + 32)
  372.                 If YesNo_str = vbNo Then Exit Sub
  373.                 Save
  374.             
  375.            Case "SD"
  376.                 SD_Text
  377.             
  378.            Case "HD"
  379.                 HD_Text
  380.            Case "sx"
  381.                 List
  382.             
  383.            Case "Item"
  384.                 If Trim(Text1.Text) = "" Then Exit Sub
  385.                 Dev_ItemSortAddItem.SortCode.Caption = Text1.Text
  386.                 Dev_ItemSortAddItem.SortCode.Tag = Command1.Tag
  387.                 Dev_ItemSortAddItem.Show 1
  388.                 List
  389.            Case "bz"
  390.                 Call F1bz
  391.            Case "Exit"
  392.                 Unload Me
  393.     End Select
  394. End Sub
  395. Private Sub T_Label_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  396.     tf = True
  397.     Move_Y = y
  398.     Move_X = x
  399.     Label1.Top = T_Label(Index).Top + 200
  400.     Label1.Left = T_Label(Index).Left + 200
  401.     Label2.Caption = "X=" & Text_t(Index).Left & ",Y=" & Text_t(Index).Top
  402.     Label1.Visible = True
  403. End Sub
  404. Private Sub T_Label_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  405.     If tf = True Then
  406.     
  407.         If T_Label(Index).Top - (Move_Y - y) >= 0 Then
  408.             If T_Label(Index).Top - (Move_Y - y) <= 5000 + VS_E.Value * 8 - 200 Then
  409.                 T_Label(Index).Top = T_Label(Index).Top - (Move_Y - y)
  410.                 Label1.Top = Label1.Top - (Move_Y - y)
  411.                 Text_t(Index).Top = T_Label(Index).Top - 50
  412.             End If
  413.         End If
  414.         '-------------------
  415.         If T_Label(Index).Left - (Move_X - x) >= 0 Then
  416.             T_Label(Index).Left = T_Label(Index).Left - (Move_X - x)
  417.             Label1.Left = Label1.Left - (Move_X - x)
  418.             Text_t(Index).Left = T_Label(Index).Left + T_Label(Index).Width + 100
  419.         End If
  420.         Label2.Caption = "X=" & Text_t(Index).Left & ",Y=" & Text_t(Index).Top
  421.     End If
  422. End Sub
  423. Private Sub T_Label_MouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  424.     tf = False
  425.     Label1.Visible = False
  426. End Sub
  427. Private Sub Text_T_Change(Index As Integer)
  428.     If Text_t(Index).Text <> "" Then
  429.         Text_t(Index).Text = Int(Val(Text_t(Index).Text))
  430.     End If
  431. End Sub
  432. Private Sub Text_T_DblClick(Index As Integer)
  433.     If Text_t(Index).BackColor = &HFFFFFF Then
  434.        Text_t(Index).BackColor = &HF2FAEB
  435.        Else
  436.        Text_t(Index).BackColor = &HFFFFFF
  437.     End If
  438. End Sub
  439. Private Sub Text_T_KeyPress(Index As Integer, KeyAscii As Integer)
  440.     If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
  441.     Else
  442.         KeyAscii = 0
  443.     End If
  444. End Sub
  445. Private Sub VS_E_Change()     '滚动条
  446.     If VsE_TF = True Then
  447.         If VS_int < VS_E.Value Then
  448.             Pict.Top = Pict.Top - (VS_E.Value * 8 - VS_int)
  449.         Else
  450.             If VS_int <> VS_E.Value Then
  451.                 Pict.Top = Pict.Top + (VS_int - VS_E.Value * 8)
  452.             End If
  453.         End If
  454.         VS_int = VS_E.Value * 8
  455.     End If
  456. End Sub
  457. Private Sub Save() '保存格式
  458.     On Error Resume Next
  459.     Dim i As Integer
  460.     Dim h As Integer
  461.     For i = 1 To Rows_int
  462.         If Val(Text_t(i).Text) > Rows_int Or Val(Text_t(i).Text) <= 0 Then
  463.             MsgBox "Tab数必须是1至" & Rows_int & "之间的连续数值", 48
  464.             Text_t(i).SetFocus
  465.             Exit Sub
  466.         End If
  467.         '--------------------
  468.         For h = i + 1 To Rows_int
  469.             If Text_t(i).Text = Text_t(h).Text Then
  470.                 MsgBox "Tab数值不能重复!", 48
  471.                 Text_t(h).SetFocus
  472.                 Exit Sub
  473.             End If
  474.         Next
  475.     Next
  476.     
  477.     
  478.     For i = 1 To Rows_int
  479.         Ssql_str = "UPDATE dev_Itemsortlist SET ItemLeft=" & T_Label(i).Left & ",ItemTop=" & T_Label(i).Top _
  480.                        & ",Tab=" & Text_t(i).Text & " where ItemCode='" & T_Label(i).Tag & "' and isid=" & Val(Command1.Tag)
  481.         Cw_DataEnvi.DataConnect.Execute Ssql_str
  482.     Next i
  483. End Sub
  484. Private Sub SD_Text() '竖对
  485.     Dim i As Integer: Dim y As Integer
  486.     y = 1
  487.     For y = 1 To Text_t.Count - 1
  488.         If Text_t(y).BackColor = &HF2FAEB Then
  489.             For i = 1 To Text_t.Count - 1
  490.                 If Text_t(i).BackColor = &HF2FAEB Then
  491.                     If Text_t(y).Top > Text_t(i).Top Then
  492.                         y = i
  493.                     End If
  494.                 End If
  495.             Next i
  496.             Exit For
  497.         End If
  498.     Next y
  499.     
  500.     For i = 1 To Text_t.Count - 1
  501.         If Text_t(i).BackColor = &HF2FAEB Then
  502.             Text_t(i).Left = Text_t(y).Left
  503.             T_Label(i).Left = Text_t(i).Left - T_Label(i).Width - 100
  504.             Text_t(i).BackColor = &HFFFFFF
  505.         End If
  506.     Next i
  507. End Sub
  508. Private Sub HD_Text() '横对
  509.     Dim i As Integer: Dim y As Integer
  510.     y = 1
  511.     For y = 1 To Text_t.Count - 1
  512.         If Text_t(y).BackColor = &HF2FAEB Then
  513.             For i = 1 To Text_t.Count - 1
  514.                 If Text_t(i).BackColor = &HF2FAEB Then
  515.                     If Text_t(y).Top > Text_t(i).Top Then
  516.                         y = i
  517.                     End If
  518.                 End If
  519.             Next i
  520.             Exit For
  521.         End If
  522.     Next y
  523.     
  524.     For i = 1 To Text_t.Count - 1
  525.         If Text_t(i).BackColor = &HF2FAEB Then
  526.             Text_t(i).Top = Text_t(y).Top
  527.             T_Label(i).Top = Text_t(i).Top + 50
  528.             Text_t(i).BackColor = &HFFFFFF
  529.         End If
  530.     Next i
  531. End Sub