To add a method to your RAD C++
control, you first need to invoke the "Add Method to C++ Control" dialog by
clicking the right mouse button on the control tool button (in the RadVC toolbox) and then
selecting "Add Method" context menu item:
For our "Circle" control, we will
add a method called "void AboutBox()". When called, this method displays a
simple textual message box.
When Clicked on the "OK" button in
"Add Method" dialog, RadVC opens the control implementation file (circle.cpp)
and highlights the "AboutBox" function..
void CCircle::AboutBox()
{
}
Now add the code to display a message box
inside the function body as follows:
void CCircle::AboutBox()
{
::MessageBox(m_hWnd,
_T("Circle RAD C++
Control\nCopyright(R), 2001"),
_T("AboutBox"),
MB_OK);
}
Next >> Part 8: Adding
Resources to the Control |