Click to See Complete Forum and Search --> : Drawing in a dialog box
mr_mombob
May 27th, 2002, 12:31 PM
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
twanvl
May 27th, 2002, 05:50 PM
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
mr_mombob
May 27th, 2002, 07:03 PM
I am using MFC. If there's a better way to do it, I'm all ears. Thanks
mr_mombob
May 27th, 2002, 07:15 PM
I am using MFC. If there's a better way to do it, I'm all ears. Thanks
aicungbiet
May 28th, 2002, 07:44 AM
use OnPaint method in your derived class from CDialog to do this.
OK.
mr_mombob
May 28th, 2002, 12:21 PM
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.
aicungbiet
May 28th, 2002, 09:13 PM
this is an example !
OK
akia
May 31st, 2002, 08:50 AM
C examples of API calls for common dialoge boxes. With many other examples in different languages.
http://users.chariot.net.au/~akia/Home.htm
pradeepkrao
May 21st, 2003, 03:15 AM
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....
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);
}
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.