Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.66 KB | None | 0 0
  1. Public Class Program
  2.     Private WithEvents Login_form As Login_form = New Login_form()
  3.     Private WithEvents Options As Options = New Options()
  4.  
  5.     Sub New()
  6.  
  7.         ' This call is required by the designer.
  8.         InitializeComponent()
  9.  
  10.         ' Add any initialization after the InitializeComponent() call.
  11.         Me.Opacity = 0
  12.         Me.ShowInTaskbar = False
  13.         StartApp()
  14.     End Sub
  15.  
  16.     Sub StartApp()
  17.         NotifyIcon.Visible = True
  18.         If My.Settings.Username.Trim = "" Or My.Settings.Password.Trim = "" Or My.Settings.Domain.Trim = "" Or My.Settings.Server.Trim = "" Then
  19.             NotifyIcon.ContextMenuStrip.Enabled = False
  20.             Login_form.Show()
  21.         Else
  22.             StartBot()
  23.         End If
  24.     End Sub
  25.  
  26.     Private Sub Program_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
  27.         NotifyIcon.Dispose()
  28.     End Sub
  29.  
  30.     Private Sub ExitToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
  31.         Me.Close()
  32.     End Sub
  33.  
  34.     Public Sub StartBot()
  35.  
  36.     End Sub
  37.  
  38.     Public Sub StopBot()
  39.  
  40.     End Sub
  41.  
  42.     Private Sub Login_form_FormSaved() Handles Login_form.FormSaved
  43.         LogInToolStripMenuItem.Visible = False
  44.         Options.Show()
  45.     End Sub
  46.  
  47.     Private Sub Options_FormSaved() Handles Options.FormSaved
  48.         LogInToolStripMenuItem.Enabled = True
  49.         StartBot()
  50.     End Sub
  51.  
  52.     Private Sub LogInDataToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInDataToolStripMenuItem.Click
  53.         Login_form.Show()
  54.         StopBot()
  55.     End Sub
  56.  
  57.     Private Sub OptionsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptionsToolStripMenuItem.Click
  58.         Options.Show()
  59.         StopBot()
  60.     End Sub
  61.     Private Sub Login_form_NotLoggedIn() Handles Login_form.NotLoggedIn
  62.         NotifyIcon.ShowBalloonTip(10000)
  63.         NotifyIcon.ContextMenuStrip.Enabled = True
  64.         ViewToolStripMenuItem.Enabled = False
  65.         EditToolStripMenuItem.Enabled = False
  66.         LogInToolStripMenuItem.Visible = True
  67.     End Sub
  68.     Private Sub NotifyIcon_BalloonTipClicked(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon.BalloonTipClicked
  69.         Dim login_form As Login_form = New Login_form
  70.         Login_form.Show()
  71.     End Sub
  72.  
  73.     Private Sub LogInToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LogInToolStripMenuItem.Click
  74.         Dim login_form As Login_form = New Login_form
  75.         Login_form.Show()
  76.     End Sub
  77. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement