PictureBox MouseMove Event


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: PictureBox MouseMove Event

  1. #1
    Eric Hudson Guest

    PictureBox MouseMove Event


    Hi,

    I am about to show how little I know about Visual Basic. Thanks for any assistance
    you may be able to offer.

    I am attempting to develop a VB application that looks and feels like a web
    application. I have developed images that will be displayed along the left
    side of the page. I want to allow the user to mouseover an image and have
    the image change to the second image thus indicating change. I hope I am
    making sense. Can someone please tell me how to do this? Will I need some
    sort of different code when I move my mouse outside of the image?

    Additionally, can someone please point me to a website with additional information
    about having a VB app look like a website. I hope not to have to bother this
    discussion group again.

    Once again, thanks for any help you are able to offer.

    Eric

  2. #2
    Miroslav St. Jeliaskoff Guest

    Re: PictureBox MouseMove Event

    Hi Eric,
    Just a hint:
    Option Explicit
    Private blnChanged As Boolean

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

    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If blnChanged = False Then
    Picture1.Picture = LoadPicture("C:\new.bmp")
    blnChanged = True
    End If

    End Sub

    I use the blnChanged to mark if the Picture has changed, because every move in the borders of the picture box will fire the MouseMove event. So when that event has fired once no changes to be made until the mouse moves on the main form and outside the picture box.

    Cheers,
    Miroslav St. Jeliaskoff

    "Eric Hudson" <eric@hudnet.com> wrote in message news:3bd207ac$1@news.devx.com...
    >
    > Hi,
    >
    > I am about to show how little I know about Visual Basic. Thanks for any assistance
    > you may be able to offer.
    >
    > I am attempting to develop a VB application that looks and feels like a web
    > application. I have developed images that will be displayed along the left
    > side of the page. I want to allow the user to mouseover an image and have
    > the image change to the second image thus indicating change. I hope I am
    > making sense. Can someone please tell me how to do this? Will I need some
    > sort of different code when I move my mouse outside of the image?
    >
    > Additionally, can someone please point me to a website with additional information
    > about having a VB app look like a website. I hope not to have to bother this
    > discussion group again.
    >
    > Once again, thanks for any help you are able to offer.
    >
    > Eric



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center