Results 1 to 7 of 7

Thread: I could use some extra help on a mouse rollover code, anyone up for the challange?

  1. #1

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Earlier, Seaweed had given me the following code to allow me the ability to use a Mouse Rollover. This was a great function. The problem I am having is that when I run my app, the act of MouseOver causes a quick flicker or flash....This will not be acceptable for the software I am working on. There must be a better way to code a "JAVA like rollover effect", that is efficient, and flicker free?



    Seaweed's code:

    Option Explicit

    Private Sub Form_Load()
    Image1.Visible = False
    End Sub

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As
    Single)
    Image1.Visible = False
    End Sub

    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As

    Single)
    Image1.Visible = True
    End Sub


    Any help will be greatly appreciated,
    Daniel Christie

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    Why does there HAVE to be a more efficient way or a "flicker free" way?

    In Visual Basic forms at some stage need to be "refreshed" and this process causes the repainting of the form with all of the current controls.

    This process in MOST cases, including applications like Word and other major commercial products DO flicker from time to time... This is unavoidable unless you purchase a "Windows Accellorator" graphics card that has additional and faster memory with which to store the screen buffers for refreshing.

    The only way you are going to get rid of that flicker is if you implement a graphical concept called "Double Buffering" but that only works for graphics and not GUI screens.

    You will just have to live with the little flicker... as far as it being "unacceptable" I doubt it very much.... try it on a computer running at 500 Mhz and I think you will hardly see a flicker at all.

  3. #3

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    thanks

    The software I am assigned to emulate does not flicker. (I can not get the source for it though). Neither Netscape or Internet Explorer flicker when switching images on the "MouseOver". It seems that VB is incapable of performing a flicker free rollover effect, but I am not as skilled to determine that. I use a Celery 366mhz with 128mb ram and a 16mb AGP Viper 550, my coding works great but my box is not the environment that this software will most likely be used on. I need to target it for something more like a PentiumII. 200mhz with 64mb ram and a 4mb video card. I tried my program on a two targeted type of boxes and it was extremely flickery (not the technical term but you get the point). Most likely it is just my coding that is the culprit. If you know a better coding, please by all means let me in on it.

    Much appreciated,
    Daniel Christie

  4. #4
    Addicted Member Geoff Gunson's Avatar
    Join Date
    Jun 1999
    Posts
    241
    By flicker do you mean that the image is only shown for as long as the mouse is over the label. If so you could try this:

    Private Sub Form_Load()
    Image1.Visible = False
    Timer1.Enabled = False
    End Sub


    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Image1.Visible = True
    Timer1.Enabled = True
    End Sub



    Private Sub Timer1_Timer()
    Image1.Visible = False
    Timer1.Enabled = False
    End Sub

    By using the timer to determin how long the image is displayed can be changed by the interval property.

    HTH

    Geoff

  5. #5

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Geoff

    Geoff,

    what I mean by flicker is that once your mouse rolls out from over the image the image set to visible=false becomes true and the mouse over image is set to visible = false. I'm sure you are familar with the java scripted rollover. Java RollOver is a seemless transition. My VB coding is not as seemless, you can see a quick flicker just as the mouse rolls over the targeted spot and switches the image for another on older boxes.

  6. #6
    Hyperactive Member wasiq's Avatar
    Join Date
    Jan 2000
    Location
    Karachi, Sindh, Pakistan
    Posts
    274

    Lightbulb

    I have a source code which answers your question and i mailed it to you.

  7. #7

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Smile Wasiq

    Wasiq,

    I thank you very much for the "HighlightControl.zip". I looked it over in Notepad and it looks promising, I am not infront of a PC with VB so I will try it later, thanks.

    Much appreciated,
    Daniel christie

    P.S. I will keep ya posted.

Posting Permissions

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



Click Here to Expand Forum to Full Width