我想将员工ID增加为E1,E2,E3等等如何做到这一点.... Val(TextBox19.Text)+ 1我这样做是为了增加1,2,3但是如何追加E在VB.net中每个数字的开头
答案 0 :(得分:0)
我通过偷偷摸摸地做到这一点...... 但我认为这就是你正在寻找的东西。每次点击按钮,你都会得到E" E" +递增的数字。
对这个想法很感兴趣,我最终坚持了5个小时:)(没什么好做的)
Public Class Form1
'When Form1 loads.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'We hide TextBox1
TextBox1.Hide()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'This will increment +1 in the hidden textbox.
Dim i As Integer
i = Val(TextBox1.Text) + 1
TextBox1.Text = i
'We dim the result of the hidden textbox as string, then finally connect "Add" with "Result"
Dim Add As String
Add = "E"
Dim Result As String
Result = TextBox1.Text
TextBox2.Text = Add & Result
End Sub
End Class