Sports Day Speech

Topics: Button, Subroutine, Exception handling Pages: 7 (978 words) Published: August 25, 2013
1. Imports System.IO
2. Public Class Form1
3. Dim index As Integer
4. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 5. If bdialog.ShowDialog = Windows.Forms.DialogResult.OK Then 6. TextBox1.Text = bdialog.SelectedPath 7. index = 0

8. Me.listbox1.Items.Clear()
9. For Each Image As String In My.Computer.FileSystem.GetFiles(TextBox1.Text, FileIO.SearchOption.SearchTopLevelOnly) ', "*.gif*", "*.jpg*", "*.bmp*", "*.png*") 10. Me.listbox1.Items.Add(Image) 11. index += 1

12. Next
13. Button4.Enabled = True
14. Button5.Enabled = True
15. Button8.Enabled = True
16. Button9.Enabled = True
17. Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom 18. End If
19. If index > 0 Then
20. listbox1.SelectedIndex = 0 21. Else
22. Me.listbox1.Items.Add("folder is empty") 23. End If
24. label2.Text = "total number files in this folder are" & index 25. End Sub
26.  
27. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 28. Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom 29. Try

30. PictureBox1.Load(TextBox1.Text) 31. Catch ex As Exception
32. MsgBox("preview not available", MsgBoxStyle.OkOnly) 33. End Try
34.  
35. End Sub
36.  
37.  
38.  
39. Private Sub listbox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles listbox1.SelectedIndexChanged 40. TextBox1.Text = listbox1.SelectedItem 41. End Sub

42.  
43. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 44. Me.Close()
45. End Sub
46.  
47. Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click 48. If Me.ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then 49. PictureBox1.BackColor = Me.ColorDialog1.Color 50. End If

51. End Sub
52.  
53. Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click 54. PictureBox1.BackColor = Color.Transparent() 55. End Sub

56.  
57. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click 58. Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom 59. Try

60. If listbox1.SelectedIndex < index Then 61....
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • speech of teachers day Essay
  • Sports Day Research Paper
  • Sports speech Essay
  • introductory speech of a new principal on sports day Essay
  • Drugs in sport speech Essay
  • Festival and Sports day Essay
  • Sports Day in Carmel Essay
  • Sports Day Research Paper

Become a StudyMode Member

Sign Up - It's Free