[VB.NET]自動補0教學

在此我提供常用的方法

Padleft

範例:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label1.Text = TextBox1.Text.PadLeft(4, "0")
End Sub
End Class