Hello people.
I am drawing rect in my application on button click.
but i want draw it on start of application. as i am drawing on OninitDialog function it will not drawing anything on it.
so how can i draw it on starting application?
What I have tried:
void XYZ::OnBnClickedOk()
{
CRect rc;
m_grpDisp.GetClientRect(&rc);
ScreenToClient(&rc);
int width = rc.Width();
int height = rc.Height();
// Get the Device Context
CClientDC dc(GetDlgItem(IDC_GDISP));
// Create a new pen
CPen lDot(PS_DASH, 2, RGB(255, 255, 255));
CPen lPoint(PS_SOLID, 4, RGB(0, 0, 255));
CPen lLine(PS_SOLID, 8, RGB(255, 0, 0));
CBrush grey(RGB(240, 240, 240));
dc.SelectObject(&grey);
dc.Rectangle((width/2)-445,8,(width/2)+445,height-3);
}