www.pudn.com > vb-sql-server.rar > frmWX.frm, change:2003-12-16,size:25048b


VERSION 5.00 
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx" 
Begin VB.Form frmWX  
   Caption         =   "销售单信息" 
   ClientHeight    =   6516 
   ClientLeft      =   48 
   ClientTop       =   348 
   ClientWidth     =   8124 
   LinkTopic       =   "Form1" 
   MDIChild        =   -1  'True 
   ScaleHeight     =   6516 
   ScaleWidth      =   8124 
   WindowState     =   2  'Maximized 
   Begin VB.TextBox txtJLDW  
      Height          =   372 
      Left            =   7680 
      TabIndex        =   24 
      Top             =   6000 
      Visible         =   0   'False 
      Width           =   252 
   End 
   Begin VB.TextBox txtWZMC  
      Height          =   372 
      Left            =   7200 
      TabIndex        =   23 
      Top             =   6000 
      Visible         =   0   'False 
      Width           =   252 
   End 
   Begin VB.TextBox txtWZDM  
      Height          =   372 
      Left            =   360 
      TabIndex        =   22 
      Top             =   6480 
      Visible         =   0   'False 
      Width           =   252 
   End 
   Begin VB.TextBox txt_YWDM  
      Height          =   372 
      Left            =   0 
      TabIndex        =   21 
      Top             =   6480 
      Visible         =   0   'False 
      Width           =   252 
   End 
   Begin VB.TextBox txtM_DATE  
      Height          =   372 
      Left            =   480 
      TabIndex        =   20 
      Top             =   6000 
      Visible         =   0   'False 
      Width           =   252 
   End 
   Begin VB.TextBox txtM_NO  
      Height          =   372 
      Left            =   0 
      TabIndex        =   19 
      Top             =   6000 
      Visible         =   0   'False 
      Width           =   252 
   End 
   Begin VB.Frame Frame2  
      Caption         =   "记录操作" 
      Height          =   972 
      Left            =   960 
      TabIndex        =   15 
      Top             =   5400 
      Width           =   6000 
      Begin VB.CommandButton cmdAdd  
         Caption         =   "添加产品" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   18 
         Top             =   360 
         Width           =   1700 
      End 
      Begin VB.CommandButton cmdModify  
         Caption         =   "修改产品" 
         Height          =   375 
         Left            =   2160 
         TabIndex        =   17 
         Top             =   360 
         Width           =   1700 
      End 
      Begin VB.CommandButton cmdDelete  
         Caption         =   "删除产品" 
         Height          =   375 
         Left            =   4080 
         TabIndex        =   16 
         Top             =   360 
         Width           =   1700 
      End 
   End 
   Begin VB.Frame Frame1  
      Caption         =   "销售单基本信息:" 
      Height          =   1920 
      Index           =   0 
      Left            =   120 
      TabIndex        =   2 
      Top             =   0 
      Width           =   7812 
      Begin VB.ComboBox Combo1  
         Height          =   288 
         Index           =   2 
         Left            =   3360 
         Style           =   2  'Dropdown List 
         TabIndex        =   34 
         Top             =   1080 
         Width           =   1812 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   6 
         Left            =   6120 
         MaxLength       =   20 
         TabIndex        =   33 
         Top             =   1080 
         Width           =   1572 
      End 
      Begin VB.CommandButton cmdCANCEL  
         Caption         =   "取消销售单" 
         Height          =   375 
         Left            =   3720 
         TabIndex        =   30 
         Top             =   1440 
         Width           =   1812 
      End 
      Begin VB.CommandButton cmdOK  
         Caption         =   "确定销售单" 
         Height          =   375 
         Left            =   1680 
         TabIndex        =   29 
         Top             =   1440 
         Width           =   1692 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   5 
         Left            =   960 
         MaxLength       =   20 
         TabIndex        =   27 
         Top             =   1080 
         Width           =   1572 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   4 
         Left            =   6120 
         MaxLength       =   20 
         TabIndex        =   25 
         Top             =   720 
         Width           =   1572 
      End 
      Begin VB.ComboBox Combo1  
         Height          =   288 
         Index           =   1 
         Left            =   6120 
         Style           =   2  'Dropdown List 
         TabIndex        =   14 
         Top             =   360 
         Width           =   1572 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   3 
         Left            =   3360 
         MaxLength       =   20 
         TabIndex        =   11 
         Top             =   720 
         Width           =   1812 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   2 
         Left            =   960 
         MaxLength       =   20 
         TabIndex        =   7 
         Top             =   720 
         Width           =   1572 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   0 
         Left            =   7920 
         MaxLength       =   20 
         TabIndex        =   5 
         Top             =   1080 
         Visible         =   0   'False 
         Width           =   372 
      End 
      Begin VB.ComboBox Combo1  
         Height          =   288 
         Index           =   0 
         Left            =   3360 
         Style           =   2  'Dropdown List 
         TabIndex        =   4 
         Top             =   360 
         Width           =   1812 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   1 
         Left            =   960 
         MaxLength       =   20 
         TabIndex        =   3 
         Top             =   360 
         Width           =   1572 
      End 
      Begin VB.Label Label2  
         Caption         =   "支付方式:" 
         Height          =   252 
         Index           =   14 
         Left            =   2640 
         TabIndex        =   32 
         Top             =   1080 
         Width           =   1092 
      End 
      Begin VB.Label Label2  
         Caption         =   "预付比例:" 
         Height          =   252 
         Index           =   13 
         Left            =   5400 
         TabIndex        =   31 
         Top             =   1080 
         Width           =   1092 
      End 
      Begin VB.Label Label2  
         Caption         =   "折扣比例:" 
         Height          =   252 
         Index           =   7 
         Left            =   240 
         TabIndex        =   28 
         Top             =   1080 
         Width           =   1092 
      End 
      Begin VB.Label Label2  
         Caption         =   "电子邮件:" 
         Height          =   252 
         Index           =   6 
         Left            =   5400 
         TabIndex        =   26 
         Top             =   720 
         Width           =   1212 
      End 
      Begin VB.Label Label2  
         Caption         =   "家庭住址:" 
         Height          =   252 
         Index           =   1 
         Left            =   240 
         TabIndex        =   13 
         Top             =   720 
         Width           =   1092 
      End 
      Begin VB.Label Label2  
         Caption         =   "联系电话:" 
         Height          =   252 
         Index           =   4 
         Left            =   2640 
         TabIndex        =   12 
         Top             =   720 
         Width           =   1092 
      End 
      Begin VB.Label Label2  
         Caption         =   "业  务  员:" 
         Height          =   252 
         Index           =   3 
         Left            =   2640 
         TabIndex        =   9 
         Top             =   360 
         Width           =   1092 
      End 
      Begin VB.Label Label2  
         Caption         =   "客户姓名:" 
         Height          =   252 
         Index           =   2 
         Left            =   5400 
         TabIndex        =   8 
         Top             =   360 
         Width           =   1092 
      End 
      Begin VB.Label Label2  
         Caption         =   "日        期:" 
         Height          =   252 
         Index           =   5 
         Left            =   240 
         TabIndex        =   6 
         Top             =   360 
         Width           =   1092 
      End 
   End 
   Begin VB.Frame Frame1  
      Caption         =   "产品信息" 
      Height          =   3252 
      Index           =   1 
      Left            =   120 
      TabIndex        =   0 
      Top             =   2040 
      Width           =   7932 
      Begin MSFlexGridLib.MSFlexGrid msgList  
         Height          =   2892 
         Left            =   120 
         TabIndex        =   1 
         Top             =   240 
         Width           =   7692 
         _ExtentX        =   13568 
         _ExtentY        =   5101 
         _Version        =   393216 
         Cols            =   4 
         FixedCols       =   2 
         AllowUserResizing=   1 
      End 
   End 
   Begin VB.Label lblTitle  
      Caption         =   "生  产  配  料  单  设  置  信  息  列  表" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H8000000D& 
      Height          =   252 
      Left            =   480 
      TabIndex        =   10 
      Top             =   240 
      Visible         =   0   'False 
      Width           =   5532 
   End 
End 
Attribute VB_Name = "frmWX" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
Public txtSQL As String 
Dim mrc As ADODB.Recordset 
Dim MsgText As String 
 
Private Sub cmdAdd_Click() 
    If gintPLLISTmode = 1 Then 
        If Trim(txtItem(0)) <> "" And Trim(Combo1(1)) <> "" And Trim(Combo1(0)) <> "" Then 
            txtSQL = "select * from outh where outh_no ='" & Trim(txtItem(0)) & "'" 
            Set mrc = ExecuteSQL(txtSQL, MsgText) 
            If mrc.EOF = False Then 
                MsgBox "已经存在相同编号的维修单记录!", vbOKOnly + vbExclamation, "警告" 
                txtItem(0).SetFocus 
                mrc.Close 
                Exit Sub 
            End If 
                     
                     
                     
                frmWX1.txtM_NO = Trim(txtItem(0)) 
                frmWX1.txtM_DATE = Trim(txtItem(1)) 
                frmWX1.txtKHDM = Trim(Combo1(1)) 
                frmWX1.txtLXDH = Trim(txtItem(3)) 
                frmWX1.txtREB = Trim(txtItem(5)) 
                frmWX1.txtYWDM = Trim(Combo1(0).ItemData(Combo1(0).ListIndex)) 
                gintPLmode = 1 
                frmWX1.Show 1 
        Else 
            MsgBox "请设置销售单的所有选项!", vbOKOnly, "警告" 
            Exit Sub 
        End If 
    ElseIf gintPLLISTmode = 2 Then 
                frmWX1.txtM_NO = Trim(txtItem(0)) 
                frmWX1.txtM_DATE = Trim(txtItem(1)) 
                frmWX1.txtKHDM = Trim(Combo1(1)) 
                frmWX1.txtLXDH = Trim(txtItem(3)) 
                frmWX1.txtREB = Trim(txtItem(5)) 
                frmWX1.txtYWDM = Trim(Combo1(0).ItemData(Combo1(0).ListIndex)) 
                gintPLmode = 1 
                frmWX1.Show 1 
    End If 
         
     
End Sub 
 
Private Sub cmdCancel_Click() 
    If msgList.Rows > 1 Then 
        txtSQL = "delete from outh where bz1 = 'N' and outh_no = '" & Trim(txtItem(0)) & "'" 
        Set mrc = ExecuteSQL(txtSQL, MsgText) 
    Else 
        Unload Me 
    End If 
End Sub 
 
Private Sub cmdDelete_Click() 
    Dim txtSQL As String 
    Dim intCount As Integer 
    Dim mrc As ADODB.Recordset 
    Dim MsgText As String 
     
     
    If Trim(msgList.TextMatrix(1, 1)) <> "" Then 
        If MsgBox("真的要删除编号为" & Trim(msgList.TextMatrix(msgList.Row, 2)) & "的配件记录吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then 
            intCount = msgList.Row 
            txtSQL = "delete outh from outh inner join dm_ck on outh.ckdm = dm_ck.dm where outh.outh_no ='" & Trim(msgList.TextMatrix(intCount, 1)) & "' and outh.wzdm = '" & Trim(msgList.TextMatrix(intCount, 2)) & "' and dm_ck.mc = '" & Trim(msgList.TextMatrix(intCount, 4)) & "'" 
                     
            Set mrc = ExecuteSQL(txtSQL, MsgText) 
                         
            frmWX.txtSQL = "select outh.outh_no,dm_wz.dm,dm_wz.mc,dm_ck.mc,outh.sl,outh.out_danj,outh.o_zk,outh.o_zke from outh inner join dm_wz on outh.wzdm = dm_wz.dm inner join dm_ck on outh.ckdm = dm_ck.dm where outh_no = '" & frmWX1.txtM_NO & "'" 
            ShowData 
        End If 
    End If 
 
 
End Sub 
 
Private Sub cmdModify_Click() 
    Dim intCount As Integer 
     
    If msgList.Rows > 1 Then 
        gintPLmode = 2 
        intCount = msgList.Row 
        If intCount > 0 Then 
            If Trim(msgList.TextMatrix(intCount, 9)) = 0 Then 
                frmWX1.txtSQL = "select dm_ck.dm,dm_ck.mc,dm_wz.dm,dm_wz.mc,outh.s_w,outh.out_danj,outh.sl,outh.o_zke from outh inner join dm_ck on outh.ckdm = dm_ck.dm inner join dm_wz on outh.wzdm = dm_wz.dm  where outh.outh_no ='" & Trim(msgList.TextMatrix(intCount, 1)) & "' and outh.wzdm = '" & Trim(msgList.TextMatrix(intCount, 2)) & "' and  dm_ck.mc = '" & Trim(msgList.TextMatrix(intCount, 4)) & "'" 
                frmWX1.txtS_W = 0 
            ElseIf Trim(msgList.TextMatrix(intCount, 9)) = 1 Then 
                frmWX1.txtSQL = "select dm_ck.dm,dm_ck.mc,dm_service.dm,dm_service.mc,outh.s_w,outh.out_danj,outh.sl,outh.o_zke from outh inner join dm_ck on outh.ckdm = dm_ck.dm inner join dm_service on outh.wzdm = dm_service.dm  where outh.outh_no ='" & Trim(msgList.TextMatrix(intCount, 1)) & "' and outh.wzdm = '" & Trim(msgList.TextMatrix(intCount, 2)) & "' and  dm_ck.mc = '" & Trim(msgList.TextMatrix(intCount, 4)) & "'" 
                frmWX1.txtS_W = 1 
            End If 
             
            frmWX1.txtM_NO = Trim(txtItem(0)) 
            frmWX1.txtM_DATE = Trim(txtItem(1)) 
            frmWX1.txtKHDM = Trim(Combo1(1)) 
            frmWX1.txtLXDH = Trim(txtItem(3)) 
            frmWX1.txtREB = Trim(txtItem(5)) 
            frmWX1.txtYWDM = Trim(Combo1(0).ItemData(Combo1(0).ListIndex)) 
             
            gintPLmode = 2 
            frmWX1.Show 1 
            
        Else 
            MsgBox "警告", vbOKOnly + vbExclamation, "请首先选择需要修改的纪录!" 
        End If 
    End If 
 
End Sub 
 
Private Sub cmdOK_Click() 
    Dim i As Integer 
    If Trim(msgList.TextMatrix(1, 1)) <> "" Then 
        If Trim(Combo1(2)) <> "" Then 
            txtSQL = "select * from outh where outh_no = '" & Trim(txtItem(0)) & "'" 
            Set mrc = ExecuteSQL(txtSQL, MsgText) 
             
            If Not mrc.EOF Then 
                Do While Not mrc.EOF 
                    If Combo1(2).ListIndex = 0 Then 
                        mrc.Fields(11) = "Y" 
                        mrc.Fields(12) = "N" 
                        mrc.Fields(13) = 0 
                        mrc.Fields(15) = "Y" 
                        'txtSQL = txtSQL & "Y','N','0','" 
                    ElseIf Combo1(2).ListIndex = 1 Then 
                        mrc.Fields(11) = "N" 
                        mrc.Fields(12) = "Y" 
                        mrc.Fields(13) = 0 
                        mrc.Fields(15) = "Y" 
                     
                        'txtSQL = txtSQL & "N','Y','0','" 
                    ElseIf Combo1(2).ListIndex = 2 Then 
                        mrc.Fields(11) = "N" 
                        mrc.Fields(12) = "N" 
                        mrc.Fields(13) = Trim(txtItem(6)) 
                        mrc.Fields(15) = "Y" 
                        'txtSQL = txtSQL & "N','N','" & Trim(txtItem(8)) & "','" 
                    End If 
                    mrc.Update 
                    mrc.MoveNext 
                Loop 
     
                mrc.Close 
                 
                For i = 1 To msgList.Rows - 1 
                    txtSQL = "select kucun.update_date,kucun.sl,kucun.total_je from kucun inner join dm_ck on kucun.ckdm = dm_ck.dm where dm_ck.mc = '" & Trim(msgList.TextMatrix(i, 4)) & "'" 
                    txtSQL = txtSQL & " and kucun.wzdm = '" & Trim(msgList.TextMatrix(i, 2)) & "'" 
                    txtSQL = txtSQL & " and kucun.s_w = '" & Trim(msgList.TextMatrix(i, 9)) & "'" 
                     
                    Set mrc = ExecuteSQL(txtSQL, MsgText) 
                     
                    If Not mrc.EOF Then 
                        If mrc.Fields(1) >= CDbl(msgList.TextMatrix(i, 5)) Then 
                            mrc.Fields(0) = txtItem(1) 
                            mrc.Fields(1) = mrc.Fields(1) - msgList.TextMatrix(i, 5) 
                            mrc.Fields(2) = mrc.Fields(2) * (mrc.Fields(1)) / (mrc.Fields(1) + msgList.TextMatrix(i, 5)) 
                            mrc.Update 
                            mrc.Close 
                        End If 
                    End If 
                Next i 
 
                 
                                 
                MsgBox "客户" & Trim(Combo1(1)) & "的购买完成!", vbOKOnly, "销售单信息" 
                Unload Me 
                 
                gintPLLISTmode = 1 
                frmWX.Show 0 
 
            End If 
        Else 
            MsgBox "请指定支付方式!", vbOKOnly + vbExclamation, "警告" 
            Combo1(2).SetFocus 
            Exit Sub 
        End If 
    Else 
        MsgBox "请指定产品信息!", vbOKOnly + vbExclamation, "警告" 
        cmdAdd.SetFocus 
        Exit Sub 
    End If 
End Sub 
 
Private Sub Combo1_Click(Index As Integer) 
     
    If Index = 1 Then 
        If gintPLLISTmode = 1 Then 
            txtSQL = "select addr,tel,email,mb_reb from dm_kh where dm = '" & Trim(Combo1(1).ItemData(Combo1(1).ListIndex)) & "'" 
            Set mrc = ExecuteSQL(txtSQL, MsgText) 
            If mrc.EOF = False Then 
                txtItem(2) = mrc.Fields(0) 
                txtItem(3) = mrc.Fields(1) 
                txtItem(4) = mrc.Fields(2) 
                txtItem(5) = mrc.Fields(3) 
     
            End If 
            mrc.Close 
        End If 
    ElseIf Index = 2 Then 
        If Combo1(2).ListIndex = 0 Or Combo1(2).ListIndex = 1 Then 
            txtItem(6).Visible = False 
            Label2(13).Visible = False 
        Else 
            txtItem(6).Visible = True 
            Label2(13).Visible = True 
 
        End If 
    End If 
         
End Sub 
 
Private Sub Form_Load() 
    Dim i As Integer 
     
    Combo1(2).AddItem "付    现" 
    Combo1(2).ItemData(Combo1(2).NewIndex) = 0 
    Combo1(2).AddItem "记    账" 
    Combo1(2).ItemData(Combo1(2).NewIndex) = 1 
    Combo1(2).AddItem "预    付" 
    Combo1(2).ItemData(Combo1(2).NewIndex) = 2 
     
    txtItem(6).Visible = False 
    Label2(13).Visible = False 
     
 
    If gintPLLISTmode = 1 Then 
        ShowTitle 
         
        txtItem(0) = GetRkno() 
         
        txtSQL = "select dm,mc from dm_ywy" 
        Set mrc = ExecuteSQL(txtSQL, MsgText) 
        If mrc.EOF = False Then 
            Do While Not mrc.EOF 
                Combo1(0).AddItem mrc.Fields(1) 
                Combo1(0).ItemData(Combo1(0).NewIndex) = mrc.Fields(0) 
                mrc.MoveNext 
            Loop 
        End If 
        mrc.Close 
         
        txtSQL = "select dm,mc from dm_kh" 
        Set mrc = ExecuteSQL(txtSQL, MsgText) 
        If mrc.EOF = False Then 
            Do While Not mrc.EOF 
                Combo1(1).AddItem mrc.Fields(1) 
                Combo1(1).ItemData(Combo1(1).NewIndex) = mrc.Fields(0) 
                mrc.MoveNext 
            Loop 
        End If 
        mrc.Close 
         
    ElseIf gintPLLISTmode = 2 Then 
        ShowTitle 
        ShowData 
         
        txtSQL = "select outh.outh_no,outh.out_date,dm_ywy.mc,outh.khdm,dm_kh.mc,dm_kh.ywman,dm_kh.lbdm,dm_kh.mb_reb from outh inner join dm_ywy on outh.ywman = dm_ywy.dm inner join dm_kh on outh.khdm = dm_kh.dm where outh.outh_no = '" & Trim(msgList.TextMatrix(1, 1)) & "'" 
        Set mrc = ExecuteSQL(txtSQL, MsgText) 
         
        If Not mrc.EOF Then 
            txtItem(0) = mrc.Fields(0) 
            txtItem(1) = mrc.Fields(1) 
             
            Combo1(0).AddItem mrc.Fields(2) 
            Combo1(0).ListIndex = 0 
             
            Combo1(1).AddItem mrc.Fields(3) 
            Combo1(1).ListIndex = 0 
             
            For i = 2 To 5 
                txtItem(i) = mrc.Fields(i + 2) 
            Next i 
             
            mrc.Close 
        End If 
    ElseIf gintPLLISTmode = 3 Then 
        ShowTitle 
        ShowData 
     
    End If 
     
    txtItem(1) = Format(Now, "yyyy-mm-dd") 
     
End Sub 
 
Private Sub Form_Resize() 
    If Me.WindowState <> vbMinimized And fMainForm.WindowState <> vbMinimized Then 
        '边界处理 
        If Me.ScaleHeight < 10 * lblTitle.Height Then 
             
            Exit Sub 
        End If 
        If Me.ScaleWidth < lblTitle.Width + lblTitle.Width / 2 Then 
             
            Exit Sub 
        End If 
        '控制控件的位置 
                 
        lblTitle.Top = lblTitle.Height 
        lblTitle.Left = (Me.Width - lblTitle.Width) / 2 
         
        Frame1(0).Left = (Me.Width - Frame1(0).Width) / 2 
         
        Frame1(1).Top = 1920 
        Frame1(1).Width = Me.ScaleWidth - 200 
        Frame1(1).Left = Me.ScaleLeft + 100 
        Frame1(1).Height = Me.ScaleHeight - 3500 
         
        msgList.Top = 240 
        msgList.Width = Me.ScaleWidth - 500 
        msgList.Left = Frame1(1).Left + 10 
        msgList.Height = Me.ScaleHeight - 4000 
         
         
        Frame2.Top = Frame1(1).Top + Frame1(1).Height + 50 
        Frame2.Left = Me.ScaleWidth / 2 - 3000 
    End If 
End Sub 
 
 
 
Public Sub FormClose() 
    Unload Me 
End Sub 
Public Sub ShowData() 
     
    Dim j As Integer 
    Dim i As Integer 
    Dim MsgText As String 
 
   
    Set mrc = ExecuteSQL(txtSQL, MsgText) 
        With msgList 
        .Rows = 1 
         
        Do While Not mrc.EOF 
            .Rows = .Rows + 1 
            For i = 1 To mrc.Fields.Count 
                If Not IsNull(Trim(mrc.Fields(i - 1))) Then 
                Select Case mrc.Fields(i - 1).Type 
                    Case adDBDate 
                        .TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd") 
                    Case Else 
                        .TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & "" 
                End Select 
                End If 
            Next i 
            mrc.MoveNext 
        Loop 
         
           
    End With 
    mrc.Close 
     
     
End Sub 
 
 
'显示Grid表头 
Private Sub ShowTitle() 
    Dim i As Integer 
     
    With msgList 
        .Cols = 10 
        .TextMatrix(0, 1) = "维修单编号" 
        .TextMatrix(0, 2) = "配件编号" 
        .TextMatrix(0, 3) = "配件名称" 
        .TextMatrix(0, 4) = "出货仓库" 
        .TextMatrix(0, 5) = "数    量" 
        .TextMatrix(0, 6) = "单    价" 
        .TextMatrix(0, 7) = "折扣比例" 
        .TextMatrix(0, 8) = "总 金 额" 
         
        
         
        '固定表头 
        .FixedRows = 1 
                 
        '设置各列的对齐方式 
        For i = 0 To 9 
            .ColAlignment(i) = 0 
        Next i 
         
         
        '表头项居中 
        .FillStyle = flexFillRepeat 
        .Col = 0 
        .Row = 0 
        .RowSel = 1 
        .ColSel = .Cols - 1 
        .CellAlignment = 4 
         
        '设置单元大小 
        .ColWidth(0) = 1000 
        .ColWidth(1) = 1000 
        .ColWidth(2) = 2000 
        .ColWidth(3) = 1000 
        .ColWidth(4) = 1000 
        .ColWidth(5) = 1000 
        .ColWidth(6) = 1000 
        .ColWidth(7) = 1000 
        .ColWidth(8) = 1000 
        .ColWidth(9) = 0 
 
        .Row = 1 
         
    End With 
End Sub 
 
 
 
 
Private Sub msgList_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 
    '右键弹出 
    If Button = 2 And Shift = 0 Then 
        
    End If 
     
End Sub