TALSOFT
Active member
- Joined
- Feb 23, 2012
- Messages
- 34
- Programming Experience
- 5-10
VB.NET:
Public Class Colors Dim cs As Integer = 1
Dim LastPick As Integer = 0
Public Function ScreenX() As Integer
Dim X As Integer = Screen.PrimaryScreen.Bounds.Width
Return X
End Function
Public Function ScreenY() As Integer
Dim Y As Integer = Screen.PrimaryScreen.Bounds.Height
Return Y
End Function
Public Function Grow_cS()
If cs = 1 Then
If cS1.Visible = False Then cS1.Show()
If cS1.Height < Me.Height Or cS1.Width < Me.Width Then
cS1.Height += 8
cS1.Width += 16
GoTo Skip
End If
cs = 2
cS1.BackColor = ChangeColor()
cS1.Height = 1
cS1.Width = 1
cS1.Hide()
Skip:
End If
If cs = 2 Then
If cS2.Visible = False Then cS2.Show()
If cS2.Height < Me.Height Or cS1.Width < Me.Width Then
cS2.Height += 8
cS2.Width += 16
GoTo Skip
End If
cs = 1
cS2.BackColor = ChangeColor()
cS2.Height = 1
cS2.Width = 1
cS2.Hide()
End If
Return 0
End Function
Private Sub InitialTest_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
'Close the form when escape is press
If e.KeyValue = Keys.Escape Then
Me.Close()
End If
End Sub
Private Sub Colors_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'############
'Center Form in screen
'############
Me.Size = New System.Drawing.Size(ScreenX, ScreenY)
'####END#####
'############
'Center Word Label
'############
Label1.SetBounds((Me.ClientSize.Width - Label1.Width) / 2, (Me.ClientSize.Height - Label1.Height) / 2, 0, 0, BoundsSpecified.Location)
'####END#####
TimerCS.Start()
End Sub
Public Function ChangeColor() As Color
Top:
Dim Pick As New System.Random
Dim Number As Integer = 0
Number = Pick.Next(0, 5)
If Number = LastPick Then GoTo Top
If Number = 0 Then Return Color.Black
If Number = 1 Then Return Color.Red
If Number = 2 Then Return Color.Blue
If Number = 3 Then Return Color.Yellow
If Number = 4 Then Return Color.White
If Number = 5 Then Return Color.Green
LastPick = Number
Number = 0
End Function
Private Sub TimerCS_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerCS.Tick
Grow_cS()
End Sub
End Class
Basically, I have a forum that is fullscreen, when a timer ticks at a 1/100th interval (timer tick is set to 1) a panel grows until it has reached the screen dimensions, then it is suppose to switch to the other panel, change its color and hide itself. The second panel is suppose to complete that same task and reset its size to default.
PS I know its been ages since I have been on here, my wife and I just got out of the homeless shelter
Last edited: