Program to Create a VB.NET desktop application to check the string/char exists in an entered name.

Program UI :

141

 

Program Code :

Public Class Searching

Private Sub btnExit_Click(sender AsObject, e AsEventArgs) HandlesbtnExit.Click

Close()

End Sub

Private Sub btnClear_Click(sender AsObject, e AsEventArgs) HandlesbtnClear.Click

txtChrStr.Clear()

txtSearch.Clear()

End Sub

 

PrivateSubbtnSearch_Click(sender AsObject, e AsEventArgs) HandlesbtnSearch.Click

Dim Str, Search As String

Dim Len1, Len2, i, f AsInteger

f = 0

Str = txtChrStr.Text

Search = txtSearch.Text

Len1 = Str.Length

Len2 = Search.Length

Fori = 1 To Len1

If Search = Mid(Str, i, Len2) Then

f = 1

EndIf

Next

 

If f = 1 Then

MsgBox(“Exist !!!”)

Else

MsgBox(“Not Exist !!!”)

End If

End Sub

 

End Class

Output:

14

 

 

Advertisements

Program to Create a VB.NET desktop application for determining details of selected date using datetimepicker

Program UI:

aa

Program Code:

Public Class Programmingfromscratch

PrivateSub DateTimePicker1_ValueChanged(sender AsObject, e AsEventArgs) Handles DateTimePicker1.ValueChanged

DateTimePicker1.CalendarForeColor = Color.Red

txtDay.Text = DateTimePicker1.Value.DayOfWeek.ToString()

txtDate.Text = DateTimePicker1.Value.Day

txtMonth.Text = DateTimePicker1.Value.Month

txtYear.Text = DateTimePicker1.Value.Year

txtHour.Text = DateTimePicker1.Value.Hour

txtMinute.Text = DateTimePicker1.Value.Minute

TxtSecond.Text = DateTimePicker1.Value.Second

EndSub

PrivateSubbtnClr_Click(sender AsObject, e AsEventArgs) HandlesbtnClr.Click

txtDay.Clear()

txtDate.Clear()

txtMonth.Clear()

txtYear.Clear()

txtHour.Clear()

txtMinute.Clear()

TxtSecond.Clear()

EndSub

PrivateSubbtnCancel_Click(sender AsObject, e AsEventArgs) HandlesbtnCancel.Click

Me.Close()

EndSub

 

EndClass

Output :

aa