CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Posts
    72

    Resize Line Object at Runtime

    I need to be able to allow users to resize a line object on a screen at runtime. Is there a way to get the form mousedown event or an API to recognize a line object if a mousedown occurs within about 60 twips of the line object? Once I get the line object index number I will then place little picture boxes at each end to handle the resizing.

    Or would it be easier to create a line object with the appropriate events. Any examples of this would be greatly appreciated.
    Thanks.

  2. #2
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Resize Line Object at Runtime

    I think what I would do, is use API to draw the lines based on values stored in an array. Using PtInRect could check for mouse proximity, but if the lines are equally spaced, you could just calculate which one is nearest the mouse. You could also use API (or shape controls) to draw the resizing rectangles.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

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