Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- txtDay1.Text = Format(Date.Today, "MM/dd/yyyy")
- txtDay2.Text = Format(Date.Today, "MM/dd/yyyy")
- End Sub
- Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
- Dim Text1, Char1, i As Integer
- Char1 = 0
- Text1 = Len(txtSentense.Text)
- For i = 0 To Text1
- txtSentense.Focus()
- txtSentense.SelectionStart = i
- txtSentense.SelectionLength = 1
- If txtSentense.SelectedText = txtChar.Text Then
- Char1 = Char1 + 1 '
- End If
- Next
- lblDisplay.Text = "You have " & Char1 & " Character " & txtChar.Text
- End Sub
- Private Sub btnGet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGet.Click
- Dim Array1() As String
- Array1 = Split(txtParagraph.Text, " ")
- Dim FirstWord As String
- FirstWord = Array1(0)
- lbl1stWord.Text = FirstWord
- End Sub
- Private Sub btnSortAscending_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSortAscending.Click
- Dim Array1() As String
- Array1 = Split(txtSortSentense1.Text, " ")
- System.Array.Sort(Of String)(Array1)
- Dim value As String
- Dim value1 As String = ""
- For Each value In Array1
- value1 = value1 + " " + value & vbCrLf
- Next
- txtSort.Text = value1
- End Sub
- Private Sub btnDays_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDays.Click
- Dim d1 As DateTime = Convert.ToDateTime(txtDay1.Text)
- Dim d2 As DateTime = Convert.ToDateTime(txtDay2.Text)
- Dim t1 As TimeSpan = d2 - d1
- lblDays.Text = t1.Days & " Days"
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement