Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

can someone help me take a look my code

$
0
0

I write a code about textbox1 + textbox2 = textbox3 

For example, textbox1 is (1) + textbox2 is (3) = then textbox3 gets 4

I want to ask if textbox3. If the decimal point is always obtained, an error message will appear and it cannot be saved in the database

Below is my code. Please advise thanks

Private Sub txtsg2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsg2.TextChanged
        Dim TB1Integer As Double
        Dim TB2Integer As Double
        If Double.TryParse(txtsg1.Text, TB1Integer) AndAlso Double.TryParse(txtsg2.Text, TB2Integer) Then
            Total1_2.Text = CStr(TB1Integer + TB2Integer)
        Else
            MessageBox.Show("Please enter a number in both boxes.")
        End If
    End Sub

i try writing this code 

  Dim mystring As String
        mystring = TextBox5.Text

        Dim arr() As String = {mystring}
        Dim value1 As String
        value1 = TextBox5.Text
      
        If value1 = Array.Find(arr, Function(x) (x.StartsWith("."))) Then
            MessageBox.Show("Pls Make Sure You Fill In Correct Number")
        Else
            MessageBox.Show("SAVE DATA SUCCESS")
        End Ifbut i fail to find (.)decimal point

can someone help me take a look and give me an advise or comment 

thanks a lot




Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>