View Single Post
Old Mar 27th, 2008, 10:56 PM   #5
Jabo
Not a user?
 
Join Date: Sep 2007
Posts: 231
Rep Power: 1 Jabo is on a distinguished road
Re: First-time setup of application

The code that I tried is the first IF statement. I realize that the form hasn't loaded yet and can't be hid, but why wouldn't it show my other form? How can I do this better?

Also, frommail is a string that has been assigned a filepath. It was declared publicly.

vb Syntax (Toggle Plain Text)
  1. Private Sub Pinger_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.  
  3. Dim tabs() As Integer = {20, 40, 60, 80}
  4.  
  5. If IO.File.Exists(frommail) = False Then
  6. Me.Hide()
  7. frmFromEmail.Show()
  8. End If
  9.  
  10. 'Set result textbox to nothing on load
  11. rtbResult.Text = ""
  12. 'Ensure timer is enabled
  13. tmrTimer.Enabled = True
  14. 'Set toolstrip Status message
  15. tssStatus.Text = "Pinging Started"
  16. 'Set toolstrip Activity to None
  17. tssActivity.Text = "Current Task: None"
  18. 'Cause both toolstrips to redraw
  19. tssStatus.Invalidate()
  20. tssActivity.Invalidate()
  21. 'set Result textbox tabs
  22. rtbResult.SelectionTabs = tabs
  23. 'Enable Stop toolstrip and disable Start toolstrip
  24. StopToolStripMenuItem.Enabled = True
  25. StartToolStripMenuItem.Enabled = False
  26. 'Set timer interval to 15 minutes
  27. interval = 900000
  28. tmrTimer.Interval = interval
  29. 'Make email active menu checked
  30. EmailActiveToolStripMenuItem.Checked = True
  31. 'Set 15 minute menu to checked, all others unchecked
  32. MinutesToolStripMenuItem.Checked = False
  33. MinutesToolStripMenuItem1.Checked = False
  34. MinutesToolStripMenuItem2.Checked = True
  35. MinutesToolStripMenuItem3.Checked = False
  36. MinutesToolStripMenuItem4.Checked = False
  37. 'Set printing to inactive
  38. PrintingActiveToolStripMenuItem.Checked = False
  39. 'Set interval label to 15 minutes
  40. lblInterval.Text = "Ping interval: " & tmrTimer.Interval.ToString / 60000 & " minutes"
  41. 'Start timer and cause first ping to run
  42. tmrTimer.Start()
  43. Ping_list()
  44.  
  45.  
  46. End Sub
Jabo is offline   Reply With Quote