May 27th, 2002, 12:31 PM
#1
Thread Starter
New Member
Drawing in a dialog box
I'm trying to draw a graph on a dialog box for a numerical solution program I'm writing. I can draw on an SDI window, but I can't figure out how to draw on a dialog box, and it's driving me nuts. I'm using VC++ 6. Thanks
May 27th, 2002, 05:50 PM
#2
Are you using MFC?
In WinAPI it's pretty much the same as with a normal window. You just handle the WM_PAINT message in the DialogProc. You can then get a hDC with BeginPaint
May 27th, 2002, 07:03 PM
#3
Thread Starter
New Member
I am using MFC. If there's a better way to do it, I'm all ears. Thanks
May 27th, 2002, 07:15 PM
#4
Thread Starter
New Member
I am using MFC. If there's a better way to do it, I'm all ears. Thanks
May 28th, 2002, 07:44 AM
#5
New Member
use OnPaint method in your derived class from CDialog to do this.
OK.
May 28th, 2002, 12:21 PM
#6
Thread Starter
New Member
I'm a little new to VC++ Can anyone give me an example of some code to draw a line somewhere on a dialog box? Thanks.
May 28th, 2002, 09:13 PM
#7
New Member
Attached Files
May 31st, 2002, 08:50 AM
#8
Lively Member
C examples of API calls for common dialoge boxes. With many other examples in different languages.
http://users.chariot.net.au/~akia/Home.htm
May 21st, 2003, 03:15 AM
#9
Fanatic Member
Hi
Hi,
How to draw lines or any other on a Dialog Box.
I want to draw lines when I move my mouse...
How can I do it.. I am Using VC++ 6.0.
I have already tried using .. But no good..
Help me out....
Code:
void CPaintBDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
static CPoint p;
CPaintDC dc(this);
CPen * myPen = new CPen(PS_SOLID,2,RGB(255,0,0));
dc.SelectObject(myPen);
dc.MoveTo(p.x,p.y);
dc.LineTo(point.x,point.y);
p.x=point.x;
p.y=point.y;
delete myPen;
CDialog::OnLButtonDown(nFlags, point);
}
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width