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

    Selecting a line

    Hi,

    Could anybody please explain how the selection mechanism works?

    ie. I have drawn a straight line on a dialog window using the MoveTo() and LineTo() functions.Now, if I click on a point on that line, i want the line to be selected. I have seen in applications like MS Word that when you click a line object it gets selected;two tiny squares appear on either end of the line making it appear selected.How can we select a line drawn on a dialog window in VC++ so that we can rotate and cut the line into a number of segments etc?

  2. #2
    Join Date
    Oct 2000
    Location
    India
    Posts
    4,620

    Thumbs up Re: Selecting a line

    Hi,

    Take a look at the PtInRegion and PtInRect functions in the MSDN.

    Before that, take a look at the DrawCli sample in the MSDN. That sample
    would give you a good start.
    All luck and have a great day.

    Regards,
    V.Girish

    Visit www.geocities.com/contactgirish for Source code, Tutorials, FAQs and Downloads.

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Selecting a line

    Well, it doesn't work like that. The LineTo is used to draw a line in a device context. In MS Word, the lines are objects that are inserted into the document. It's a different ball game.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

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