以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  老师,请问我执行完了这段代码怎么光标不在TextBox1里呢  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=129102)

--  作者:whtb999
--  发布时间:2018/12/21 14:37:00
--  老师,请问我执行完了这段代码怎么光标不在TextBox1里呢
If e.KeyCode = Keys.Enter Then
    Dim jglj As String = e.Form.Controls("ComboBox1").text
    If jglj="" Then
        MessageBox.Show("必须选择加工路径!")
        Return
    End If
    Dim txt As String = e.Form.Controls("TextBox1").Text
    \'Dim tbl As Table = Tables("Product_details")
    Dim  cpid  As Integer
    Dim  jjbz  As String
    Dim jjmc   As String
    Dim jjfz  As String
    If txt = "" Then
        MessageBox.Show("qingshuru!","提醒")
        Return
    Else
        Dim dr11 As DataRow = DataTables("Product_details").SQLFind("id = \'" & txt & "\'")
        Dim dr12 As DataRow = DataTables("Glass_single_produce").sqlfind("rack = \'" & Tables("rack").Current("rack") & "\'")
        If dr12 IsNot Nothing Then \'如果找到的话
            
            If dr11("Order_number") <> dr12("Order_number") Or dr11("level_number") <> dr12("level_number") Then
                MessageBox.Show("我们不属于同一个订单,或不属于相同订单同一层,请放到其他架上!","提醒")
                Return
            End If
            
        End If
        \'
        \'cpid= dr("Product_id")
        \'jjfz=dr("lamination_group")
        \'jjbz= dr("jiajiaobiaozhi")
        \'If jjfz.Length < 2 Then
        \'MessageBox.Show("我不是多层,请核实!","提醒")
        \'Return
        \'End If
        \'End If
        \'
        \'Dim drsc As List(Of DataRow)
        \'drsc = DataTables("Product_details").Select("Product_id = \'" & cpid & "\' and laminati","level_number")
        \'Dim cp As String
        \'Dim zhid As String
        \'cp  =""
        \'zhid =""
        \'For Each drc As DataRow In drsc
        \'cp + = drc("Material_name") & "+"
        \'zhid + =drc("id") & "_"
        \'Next
        \'jjmc =(cp.SubString(0,cp.Length - 1))
        \'zhid= (zhid.SubString(0,zhid.Length - 1))
        Dim sts() As  String  = {"Product_id","Order_number","Entry_number","level_number","jiajiaobiaozhi","lamination_group"}
        \'For Each st As String In sts
        \'If Tables("订单主表").Current.isnull(st) = True Then
        \'MessageBox.Show("请将红色必填字段填写完整!","提醒")
        \'Return
        \'End If
        \'Next
        
        Dim r As Row = Tables("Glass_single_produce").AddNew
        Dim dr1 As DataRow = DataTables("Product_details").SQLFind("id = \'" & txt & "\'")
        For Each st As String In sts
            r(st) = dr1(st)
        Next
        r("single_name")=dr1("Material_name")
        r("Product_details_id")=dr1("id")
        r("Processing_route")=dr1("Processing_route")
        r("rack")=Tables("rack").Current("rack")
        r("Quantity")=1
        \'r("combination_nameer")=zhid
        \'r("date_of_entry") = Date.Now
        r("user") = _UserName
        r("Processing_name")=jglj
        r("date_of_entry")=now()
    End If
    DataTables("Glass_single_produce").Save()
    DataTables("rack").Save()
    e.Form.Controls("TextBox1").text=""
    e.Form.Controls("TextBox1").Select
End If

--  作者:有点甜
--  发布时间:2018/12/21 15:32:00
--  

加上代码,如

 

e.cancel = True


--  作者:whtb999
--  发布时间:2018/12/21 17:05:00
--  
谢谢老师!