source: trunk/Snippets/ProgressAnimation/MainForm.vb @ 155

Last change on this file since 155 was 110, checked in by roman, 12 years ago

Progress Animation VB.NET UserControl?

File size: 1.1 KB
Line 
1Imports System.Diagnostics
2Imports System.Drawing
3Imports System.Drawing.Imaging
4
5Public Class MainForm
6    Private WithEvents Animation As ProgressAnimation
7
8    Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
9        Animation = New ProgressAnimation
10        Controls.Add(Animation)
11        Animation.Dock = DockStyle.Fill
12        Dim CurrentScreen As Screen = Screen.FromControl(Me)
13        Width = CurrentScreen.WorkingArea.Width * 7 / 8
14        Height = CurrentScreen.WorkingArea.Height * 7 / 8
15        Left = (CurrentScreen.WorkingArea.Width - Width) / 2
16        Top = (CurrentScreen.WorkingArea.Height - Height) / 2
17    End Sub
18    Private Sub MainForm_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
19        If e.KeyChar = Chr(27) Then Close()
20    End Sub
21    Private Sub Animation_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles Animation.KeyPress
22        If e.KeyChar = Chr(27) Then Close()
23    End Sub
24End Class
Note: See TracBrowser for help on using the repository browser.