Tutorial Programming

Tutorial basic, Visual Studio VB.NET 2013 Pengunaan Format Function


Hallo sahabat saya akan menjelaskan Pengunaan Format Function pada visual studio 2013, oke langsung aja



Function Format Numbers


Private Sub BtnFormat_Click(sender As Object, e As EventArgs) Handles BtnFormat.Click
Label1.Text = Format(8972.234, “General Number”)
Label2.Text = Format(8972.2, “Fixed”)
Label3.Text = Format(6648972.265, “Standard”)
Label4.Text = Format(6648972.265, “Currency”)
Label5.Text = Format(0.56324, “Percent”)
End Sub






Function Format Defined 


Private Sub BtnFormat_Click(sender As Object, e As EventArgs) Handles BtnFormat.Click
Label1.Text = Format(8972.234, “0.0”)
Label2.Text = Format(8972.2345, “0.00”)
Label3.Text = Format(6648972.265, “#,##0.00?)
Label4.Text = Format(6648972.265, “$#,##0.00?)
Label5.Text = Format(0.56324, “0%”)
End Sub








Function Format Date and Time


Private Sub BtnDisplay_Click(sender As Object, e As EventArgs) Handles BtnDisplay.Click
Label1.Text = Format(Now, “General Date”)
Label2.Text = Format(Now, “Long Date”)
Label3.Text = Format(Now, “short Date”)
Label4.Text = Format(Now, “Long Time”) Label5.Text = Format(Now, “Short Time”)
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Label1.Text = Format(Now, “General Date”)
Label2.Text = Format(Now, “Long Date”)
Label3.Text = Format(Now, “short Date”)
Label4.Text = Format(Now, “Long Time”)
Label5.Text = Format(Now, “Short Time”)
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Label1.Text = Format(Now, “m”)
Label2.Text = Format(Now, “mm”)
Label3.Text = Format(Now, “mmm”)
Label4.Text = Format(Now, “mmmm”)
Label5.Text = Format(Now, “dd/mm/yyyy”)
Label6.Text = Format(Now, “mmm,d,yyyy”)
Label7.Text = Format(Now, “h:mm:ss tt”)
Label8.Text = Format(Now, “MM/dd/yyyy h:mm:ss tt”)
End Sub





Sekian tutorial saya sahabat semoga bermanfaat yah.

No comments:

Post a Comment

Tutorial Programming Designed by Templateism | Ary EJFA Copyright © 2015

Theme images by richcano. Powered by Blogger.