CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2001
    Posts
    8

    VB Coordinate System

    I would like to know how to setup a coordinate system in picturebox control to solve mathermatics question. Example a coordinate system with X-Axis range from -50 to 50cm and Y-Axis range from -50 to 50.

    Regards



  2. #2
    Join Date
    May 2000
    Location
    Sacramento, CA
    Posts
    103

    Re: VB Coordinate System

    Create a project with a default-named picturebox and two labels. Paste in this code:

    option Explicit
    private Sub Form_Load()
    Picture1.ScaleHeight = -100
    Picture1.ScaleTop = 50
    Picture1.ScaleLeft = -50
    Picture1.ScaleWidth = 100
    End Sub
    private Sub Picture1_MouseMove(Button as Integer, Shift as Integer, X as Single, Y as Single)
    Label1.Caption = "X:" & Str$(X)
    Label2.Caption = "Y:" & Str$(Y)
    End Sub





    Dave Straayer
    Varatouch, Inc.
    David H. Straayer

  3. #3
    Join Date
    Mar 2001
    Posts
    8

    Re: VB Coordinate System

    Thank you.


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