嘿家伙有没有人知道如何通过输入关键的nether tap键移动文本框? [英] Hey guys is there anybody knows how can I move in text boxes by enter key nether tap key ?

查看:84
本文介绍了嘿家伙有没有人知道如何通过输入关键的nether tap键移动文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Public Class Employee

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim con As SqlConnection = New SqlConnection("Data Source=S-MHAMEED\SQL2008RTWO;Initial Catalog=comp.task;User ID=sa;Password=likebefore")
        If TextBox1.Text = String.Empty Then
            MessageBox.Show("Please Insert Emb Number !  ")
        End If
        If ComboBox1.Text = String.Empty Then
            MessageBox.Show(" Please Insert Section ! ")
            If TextBox3.Text = String.Empty Then
                MessageBox.Show("Please Insert Emp Name ! ")
            End If
            If TextBox5.Text = String.Empty Then
                MessageBox.Show("Insert Job Description ! ")
            End If
            If TextBox6.Text = String.Empty Then
                MessageBox.Show("Insert Section Name !  ")
            End If
            If TextBox8.Text = String.Empty Then
                MessageBox.Show("Insert Basic Salary ! ")
            End If


        Else
            Using con
                con.Open()
                Dim sqlcomm As New SqlCommand()
                sqlcomm.Connection = con
                sqlcomm.CommandText = "insert_emp"
                sqlcomm.CommandType = CommandType.StoredProcedure
                sqlcomm.Parameters.AddWithValue("@emp_num", Convert.ToInt32(TextBox1.Text))
                sqlcomm.Parameters.AddWithValue("@debt_num", Convert.ToInt32(ComboBox1.Text))
                sqlcomm.Parameters.AddWithValue("@emp_name", TextBox3.Text)
                sqlcomm.Parameters.AddWithValue("@emp_p_date", DateTimePicker2.Text())
                sqlcomm.Parameters.AddWithValue("@emp_work_date", DateTimePicker1.Text())
                sqlcomm.Parameters.AddWithValue("@emp_sal", Convert.ToInt32(TextBox8.Text))
                sqlcomm.Parameters.AddWithValue("@emp_desc", TextBox5.Text)
                sqlcomm.Parameters.AddWithValue("debt_name", TextBox6.Text)
                Dim queryResult As Integer
                Dim cmd As New SqlCommand
                If queryResult > 0 Then
                    cmd.CommandText = "insert into emb_num (Dt,ID)VALUES ('" & TextBox1.Text & "' , '" & TextBox1.Text & "')"
                    queryResult = cmd.ExecuteScalar()
                    MsgBox("Added Successfuly")
                Else

                    'MessageBox.Show("Already Exists!", "ALI ENTERPRISES", MessageBoxButtons.OK, MessageBoxIcon.Information)

                End If

                sqlcomm.ExecuteNonQuery()
                ' con.Open()

                MessageBox.Show("Add Sucssfully  ")
                'TextBox1.Text = ""
                ComboBox1.Text = ""
                TextBox3.Text = ""
                TextBox5.Text = ""
                TextBox6.Text = ""
                TextBox8.Text = ""
                'Form1_Load3()
                con.Close()
            End Using
        End If
    End Sub





我尝试过:



转换点按键,在vb.net中输入键



What I have tried:

transform tap key with enter key in vb.net

推荐答案

也许这就是你要找的:

c# - 如何进入在TextBox上充当TAB按钮 - 堆栈溢出 [ ^ ]

这是C#,但C#和VB.NET的人在引擎盖下使用相同的.NET对象,这样你就会有所了解。
Maybe that is what you are looking for:
c# - How to make Enter on a TextBox act as TAB button - Stack Overflow[^]
It's for C#, but C# and VB.NET manipulate the same .NET objects under the hood, so you will get an idea.


这篇关于嘿家伙有没有人知道如何通过输入关键的nether tap键移动文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆