top of page

The Code

​

 

​

Public Class Form79

​

      '## 19.2 Format Function for Numbers ##
    '## There are two Types of Format Functions ##
    '## The Built in Function, & User-Defined Function ##

​

    '## 19.2 User-Define Format ##
    '## The Syntax of the User-Define Function is ##
    '## Format (n, "User's Format")

 


    Dim FormatNumber As Double  '## Dimension Variable as Double Precision ##
    
   Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

​

        FormatNumber = TextBox1.Text

​

       '## User-Define Format Syntax ##

        Label2.Text = Format(FormatNumber, "0.0")
       
Label3.Text = Format(FormatNumber, "0.00")
       
Label4.Text = Format(FormatNumber, "#,##0.00")
       
Label5.Text = Format(FormatNumber, "$#,##0.00")
       
Label6.Text = Format(FormatNumber, "0%")

​

    End Sub

​

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

​

        Label2.Text = ""
       
Label3.Text = ""
       
Label4.Text = ""
       
Label5.Text = ""
       
Label6.Text = ""
       
TextBox1.Text = ""

​

    End Sub

​

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

​

        Form73.Show()

          Me.Hide()

​

    End Sub


End Class

 

 

​

Website Links-173.jpg
bottom of page