CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 1999
    Posts
    21

    How to get the .right and .bottom property of a picture box

    Hi

    I have noticed that a picture box control has only got a .left and .top property. It does not have .right and .bottom property.
    How can I get it without using the following codes
    picture1.right = picture1.left + picture1.width
    picture1.bottom = picture1.top + picture1.height
    I want to use a mouse_move event that will cause a form to pop out from the sides of my MDI form whenever I move the mouse
    to the top, left, bottom and right side of my MDI form
    PLease please help me!!! Experts!

    Thanks!
    Zenn0


  2. #2
    Join Date
    Dec 1999
    Location
    Tel Aviv, Israel, Earth, Solar System
    Posts
    50

    Re: How to get the .right and .bottom property of a picture box

    First of all, you're right - there is no .right and .bottom properties. You're doing right.
    On _MouseMove event you can change .Width and .Height properties of form or any other control

    Jean Spector
    Tech Support Team Leader, CET
    [email protected]
    (in VB from 11/1999)

  3. #3
    Join Date
    Dec 1999
    Posts
    21

    Re: How to get the .right and .bottom property of a picture box

    Hi

    I am trying to write a program that will do the following functions
    1. When I move my mouse to the bottom of my mdiform, frmbottom(which I created) will popout (just like the bottom taskbar in windows programs)
    2. When I move my mouse to the right of my MDIform, frmRight(which I created) will popout (just like the office2000 taskbar in windows)

    The only difference is I did not create taskbars but instead created forms(frmbottom and frmright). How can I get my programs right, just like the way I want it. Is there any API calls which I can use to achieve this task?

    The reason why I did not use the formula
    .right = .left + .width is that there are scrollbars(both vertical and horizontal) which would affect the formula. I would have to set some tolerance using < or > signs

    Pls help and thanks a lot!

    zenn0


  4. #4
    Join Date
    Dec 1999
    Location
    Tel Aviv, Israel, Earth, Solar System
    Posts
    50

    Re: How to get the .right and .bottom property of a picture box

    Sorry, I'm too new to VB and Windows programming to use API calls heavily. I can suggest you only to get the height/width of scrollbars and to use it in your calculations - it mustn't be too hard.

    Jean Spector
    Tech Support Team Leader, CET
    [email protected]
    (in VB from 11/1999)

  5. #5
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: How to get the .right and .bottom property of a picture box

    If you are comfortable with API's then you can use GetWindowRect and getClientRect function to get the window postions ( w.r.t Screen) and Client Position (w.r.t Window)
    This also take care of Scroll bars, if any.
    You can pick up the definitions from API viewer, they are just fine

    RK

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

Featured