MTSkull
Centurion
I wrote a simple screen saver app that cycles through all the pictures in a folder. I have 1 question and 2 bugs that I need help with.
1. How do I pass the capture of the mouse move to the underlying form? Since the pic box is sized to = the form I have to put the mouse move event in the picBox control. This probably does not matter but I am curious how it is done.
2. If I hit run (F5) from inside the .net developer, it always picks up a mouse move event and shuts down the program. That is the reason for the bFirstMove form global. Is there a way to flush the mouse move buffer?
3. I compiled this and tested it out and it works as a screen saver (changed .exe to .scr). After about a 1/2 hour of continuous running I get a "System out of Memory" fault that crashes the program. Do I need to set the picBox.image to nothing to flush memory or something?
Thanks
Brian
Visual Basic:
Public bFirstMove As Boolean
Public Pics() As String
Public position As Int16
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) ;
Handles MyBase.Load
Me.CenterToScreen()
picBox.Height = Me.Height
picBox.Width = Me.Width
bFirstMove = True
Pics = Directory.GetFiles("C:\Fractals")
position = 0
picBox.Image = Drawing.Bitmap.FromFile(Pics(position))
End Sub
Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) ;
Handles MyBase.KeyUp
Me.Close()
End Sub
Private Sub picBox_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) ;
Handles picBox.MouseMove
If Not bFirstMove Then
Me.Close()
Else
bFirstMove = False
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) ;
Handles Timer1.Tick
position += 1
If position = UBound(Pics) Then position = 0
picBox.Image = Drawing.Bitmap.FromFile(Pics(position))
End Sub
1. How do I pass the capture of the mouse move to the underlying form? Since the pic box is sized to = the form I have to put the mouse move event in the picBox control. This probably does not matter but I am curious how it is done.
2. If I hit run (F5) from inside the .net developer, it always picks up a mouse move event and shuts down the program. That is the reason for the bFirstMove form global. Is there a way to flush the mouse move buffer?
3. I compiled this and tested it out and it works as a screen saver (changed .exe to .scr). After about a 1/2 hour of continuous running I get a "System out of Memory" fault that crashes the program. Do I need to set the picBox.image to nothing to flush memory or something?
Thanks
Brian