...

View Full Version : Help with VB



aning
01-30-2005, 08:05 AM
I'm new and m creating a screensaver and use the code below to maximize the picture but whenever i try to use the code below, it disables the movements of mouse and keys which means to come out of the screensaver one has to go through Ctrl+Alt+Del

Private Sub Form_Resize()
With Flash
.TOp = 0
.Left = 0
.Width = Me.ScaleWidth
.Height = Me.ScaleHeight
End With
End Sub

can anyone tell me what the problem is or is there any other method to maximize the stuff. I uses VB 6, XP pro if u needed to know.

oracleguy
01-31-2005, 03:27 AM
You need to post some more information probably. What is "flash"? What type of object?

aning
02-01-2005, 07:23 AM
"flash" is any picture!!! it disable codes like this ones-

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
QuitScreenSaver
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
QuitScreenSaver
End Sub

Private Sub QuitScreenSaver()
ShowCursor True
Unload Me
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static sngX As Single
Static sngY As Single

'initialize the pointer location
If sngX = 0 And sngY = 0 Then
sngX = X
sngY = Y
End If

'disreguard small moves
If X - Abs(sngX) > 50 Or Y - Abs(sngY) > 50 Then
QuitScreenSaver
Exit Sub
End If

sngX = X
sngY = Y

End Sub

shmoove
02-01-2005, 08:28 AM
The Form has a property that tells the application to give user input to the Form's methods before passing it on to it's components. I forgot the exact name of this property and I don't have VB installed on this computer but it's somethingPreview. Look for it in the form's properties.

shmoove

aning
02-01-2005, 09:19 AM
hey i have gone thru almost everwhere but i cant fine it! rem' its not a form but a screensaver though its almost the same.

shmoove
02-01-2005, 10:42 AM
I meant the VB meaning of a Form (ie, the base object for any GUI).

Basically, if for example, you have a button on a form, and you move your mouse over the button, the event raised is the button's mouse_moved and not the form's. In your case, you have a control called Fash on top of the whole form, so all the events are going to it instead of the form (ie, to Flash_MouseMove instead of Form_MouseMove). So you have two choices. Handle everything in flash's events (so the code in Form_MouseMove would be moved to Flash_MouseMove), or set the property I talked about before (which I still can't remember it's name, look for something with "preview" in it in the Form's property dialog).

shmoove



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum