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

    dialog box drawing problem



    Hai there i have created a dialog box , in that i am drawing some lines , i want the lines color same as background color and line width should be more than the default setting width ,

    in OnPaint()

    {


    dc.MoveTo(0,0);

    dc.LineTo(200,200);

    }

    this code works fine drwing line but inh black color , i want it to be by the same background color , and little bit width more

    can anyone help me?\

    thanx in advance

    asha



  2. #2
    Join Date
    Apr 1999
    Location
    Frankfurt, Germany
    Posts
    113

    Re: dialog box drawing problem



    Hi,

    LineTo draws the line with the selected pen. Create the pen (includes color and line width) You like with the CreatePen method of CPen and select it with CDC::SelectObject. Don't forget to reselect the old pen and delete Your pen afterwards.


    Hope for help

    Rudolf



  3. #3
    Guest

    Re: dialog box drawing problem

    Hi Asha,
    You are still there with the same problem??!!??
    Just go through the CPen::CPen function and you will be able to solve the problem.

    But one thing, if you draw the line with the background color, You definitely will not see the line since
    both are of the same color.

    Anyway all the best


    Bye
    Vittal



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