Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Help with VB

  1. #1
    New Coder
    Join Date
    Apr 2004
    Location
    Earth, located in Milky Way galaxy
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with VB

    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.
    You must dream to be a succesful person, go to sleep... www.niumai.tk is my site

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    You need to post some more information probably. What is "flash"? What type of object?
    OracleGuy

  • #3
    New Coder
    Join Date
    Apr 2004
    Location
    Earth, located in Milky Way galaxy
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "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
    You must dream to be a succesful person, go to sleep... www.niumai.tk is my site

  • #4
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    New Coder
    Join Date
    Apr 2004
    Location
    Earth, located in Milky Way galaxy
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    You must dream to be a succesful person, go to sleep... www.niumai.tk is my site

  • #6
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •