Adblock breaks this site

A Hard Question..

Discussion in 'Programming General' started by kharg0, Mar 3, 2007.

  1. kharg0

    kharg0 Active Member

    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

    how do you make it so when you hover your mouse over an image another image that may have been hidden appears??? if you dont understand plz tell me, so far i know how to make an image appear and dissapear within a time limit (or not within a limit) all i need to know is like
    Code:
    if mouse at 3,3 (image coordinates) 
    then picturebox1.show 
    if mouse at (anywhere else) then picturebox1.hide 
    i dought it's like that but you get the point :)


    Thx:)

    ok i've tried and tried and i almost have it... i put
    Code:
    If mouse.location(3, 3) Then
                PictureBox28.Show()
            End If
    the only problem is the mouse.location mouse is not declared so that won't work besides i still need it so when my mouse goes away it hides so...help

    i got another idea but you have to be good to pull this one off you could make a label that shows the mouse's coordinates and just put this code:
    Code:
    if label1.string (3,3) then
                  picturebox28.show ()

    ya im kinda new to this but i guess that might work :)

    here's another idea i got from browsing the Object Browser

    ok do this open the object browser

    now scroll down till you see MouseEventArgs click it now to the right there is a list the bottom two are used to find the x and y intiger of your mouse now i need to figure out how to make both of those show up in a label then i'll make that label's visible property to false and put this code in my back button for my web browser

    Code:
    if label.text (3,3) then
               picturebox3.show ()
    but once again i don't know how can someone plz reply???!?!?!?!
     
  2. cooladrrang

    cooladrrang Active Member

    Joined:
    Jan 21, 2007
    Posts:
    125
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

    ill post the code in a whle let me just open vb
    can you post the x,y axis of where the image is going to be displayed and the image size
    ill edit
     
  3. kharg0

    kharg0 Active Member

    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

    ok ya thx

    X:3
    Y:3

    and the image size is and will be:

    width: 50
    hight: 49

    when ur done i'll put it in my tutorial and give the credit's to you

    And i only want the image to be shown until i move my mouse of the image then i want it to go away thx:)
     
  4. cooladrrang

    cooladrrang Active Member

    Joined:
    Jan 21, 2007
    Posts:
    125
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

  5. kharg0

    kharg0 Active Member

    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

    why did you make a whole new project? i only needed a little tutorial on how to do that??

    OH ok nvm so what i download it then copy the code it would have been better to send me a litle tut instead ok i'll copy what code and put it where???

    i could send you my designer and you could put the code in but... don't steal it and say it's your's cuz i think it's pretty dam good!:)

    download from this link no one but cooladrang may download this file there is a pack in it saying if you do you WILL go to JAIL

    i changed my mind no one will see this i guess you'll have to post the code coladrrang??plz and thank you
     
  6. cooladrrang

    cooladrrang Active Member

    Joined:
    Jan 21, 2007
    Posts:
    125
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

    the codes is there inside the project i made it a proejct because its hard to explain because im using 2 pictureboxes
     
  7. kharg0

    kharg0 Active Member

    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

    Ohhh ok thx ok i tried and i tried and i fixed things up and everything but it won't work soo i guess i only need a code to make a label find x and y mouse positions and show it as 3,3 or somthing i finally figured it out i made my own code i just need some one to figure out a code to make a label show mouse x and y axis then i use dountil control to make it show the image until mouse moves off image

    so basically i really need a code to make a label show cursor X, And Y Axis

    ok maybe not my code is....

    Code:
    If Label1.Text = (3,3) Then
                PictureBox1.Show()
                Do Until True
                    Label1.Text = (3,2)
    
                Loop
    
            End If
     
  8. alexandr

    alexandr Guest

    Referrals:
    0
    A Hard Question..

    dude this is actually quite simple, all you have do do is put 2 picture boxes on your form, set one of them to visible = false . now insert this code watch for wrapping

    Public Class Form1

    Private Sub PictureBox1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseHover
    PictureBox2.Visible = True
    End Sub
    End Class
     
  9. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    A Hard Question..

    I laughed at the simplicity of what you wanted.

    All you have to do is change the image of the picturebox when the mouse has been moved over it, simlarly, change it back once the mouse has been moved off it.

    Concept alone is enough to know what to do, I suggest you study more.
     
  10. hockeykid09

    hockeykid09 Guru
    Banned

    Joined:
    Mar 16, 2007
    Posts:
    1,162
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

    Try picturebox1.Visible = False/True ect. instead of picturebox1.hide/show
     
  11. Markizano

    Markizano Active Member
    Banned

    Joined:
    Mar 2, 2006
    Posts:
    100
    Referrals:
    0
    Sythe Gold:
    0
    A Hard Question..

    Swan had the right idea, except, to expand on it, i'll say that you'll want to add a handler to the MouseHover event under the picture box. When the mouse hovers over the picture, it will change the pic to what you want (PicBox1.Picture = System.Drawing.Bitmap.FromFile("&PicPath") )
    Alternatively, you can use the pair of events that handle the mouse position immediately after the mouse has entered/left the control
    Private Sub PicBox_MouseEnter(...) Handles PicBox.MouseEnter
    Private Sub PicBox_MouseLeave(...) Handles PicBox.MouseLeave
     
< Help with VB6 portable | New StealRS, Will never break :) >


 
 
Adblock breaks this site