Source Code | Visual Basic Projects With
Private Sub ShowImage() If imageFiles IsNot Nothing AndAlso imageFiles.Length > 0 Then picImage.Image = Image.FromFile(imageFiles(currentIndex)) Me.Text = $"Image Viewer - {Path.GetFileName(imageFiles(currentIndex))}" End If End Sub
Private Sub btnLoad_Click(sender As Object, e As EventArgs) Handles btnLoad.Click Using folderDialog As New FolderBrowserDialog() If folderDialog.ShowDialog() = DialogResult.OK Then imageFiles = Directory.GetFiles(folderDialog.SelectedPath, "*.*") .Where(Function(f) f.ToLower().EndsWith(".jpg") OrElse f.ToLower().EndsWith(".png") OrElse f.ToLower().EndsWith(".bmp")) .ToArray() currentIndex = 0 ShowImage() End If End Using End Sub visual basic projects with source code
If emptyCells.Count > 0 Then Dim rnd As New Random() Dim move = emptyCells(rnd.Next(emptyCells.Count)) MakeMove(move.Item1, move.Item2, "O") End If End Sub Private Sub ShowImage() If imageFiles IsNot Nothing AndAlso
Visual Basic (VB.NET) often gets a bad rap as a "beginner's toy," but don't let the critics fool you. In the enterprise world, VB.NET is a fully supported, object-oriented language that runs on the powerful .NET framework. It is incredibly efficient for building Windows desktop applications (WinForms), automating Excel, and even creating web apps. Select Case operation Case "+" : result =
Select Case operation Case "+" : result = firstNumber + secondNumber Case "-" : result = firstNumber - secondNumber Case "*" : result = firstNumber * secondNumber Case "/" : result = firstNumber / secondNumber End Select
Public Class Calculator Dim currentInput As String = "" Dim firstNumber As Double = 0 Dim operation As String = "" Private Sub Number_Click(sender As Object, e As EventArgs) Handles Button1.Click, Button2.Click, '... etc Dim btn As Button = CType(sender, Button) currentInput &= btn.Text txtDisplay.Text = currentInput End Sub
Private Sub btnEquals_Click(sender As Object, e As EventArgs) Handles btnEquals.Click Dim secondNumber As Double = Double.Parse(currentInput) Dim result As Double = 0