Steps to create a rectangle in the client region, Visual Basic Programming

STEPS TO CREATE A RECTANGLE IN THE CLIENT REGION

1. Generate a SDI application and name it as a brush.

2. Handle the WM_LBUTTONDOWN message for the CBrushView object id.

3. In answer to Step 2 ON_WM_LBUTTONDOWN member the function would be inserted in the view accomplishment file as shown.

void CBrushView::OnLButtonDown(UINT nFlags, CPoint point)

{ }

4. Type the code below in the ON_WM_LBUTTONDOWN member function

CRect l;

CBrush b(HS_BDIAGONAL,(point.x,point.y));

CClientDC dc(this);

dc.SelectObject(&b);

//BOOL GetClientRect(LPRECT lpRect) const

GetClientRect(&l);

dc.Rectangle(l);

5. Build and then execute the project.

6. A window with lines would be exhibited whenever the left button is pressed

7. Click the left button in various places and note the color change.

8. Transform the brush style as the HS_DIAGONAL, HS_VERTICAL, HS_HORIZONTAL, and HS_CROSS for various executions and examine the output.

The Get Client Rect function imprisons the rectangular window area and stores in m_rdRect object.

Select Stock Object makes a call to the CGdi Object :: From Handle() to verify which CGdiObject to return.

290_affect of rectangle function.png

Figure: Affect of Rectangle Function

Posted Date: 10/10/2012 1:37:10 AM | Location : United States







Related Discussions:- Steps to create a rectangle in the client region, Assignment Help, Ask Question on Steps to create a rectangle in the client region, Get Answer, Expert's Help, Steps to create a rectangle in the client region Discussions

Write discussion on Steps to create a rectangle in the client region
Your posts are moderated
Related Questions
Assume that s is a string variable that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable and displ

Sets or returns wholly qualified path to a Help File. If Help file is indicated in HelpFile, it is called automatically when the user clicks Help button (or presses the F1 key) in

Software That Is Obscure: The Software hides the intensions, meaning and actions from the user. For illustration, if a user is asked whether a full installation, the custom in

PROGRAM TO ZOOM A RECTANGLE AS YOU DRAG 1. Generate a SDI application 2. Declare the 2 member variables clicked of Boolean type and m_ptoldpt of CPoint type. Use the class t

how to add the hangman images

Device Contexts: The Device Context (DC) is represented by the data type Handle to Device Context (HDC). The HDC is a handle to somewhat you can draw on; it can be the whole s

While several operations take place in an expression, each part is evaluated & resolved in a predetermined order called operator precedence. You can employ parentheses to override

Create the flowcharts using MS Visio, MS Excel or MS Word to demonstrate the algorithm. Submit your flowchart under the assignment for CH7-4-26 Flowchart. Part Printouts H

I need assistance with writing the Tryparse I have 98% of the assignment done.

A triangle is equilateral if all three sides are equal, isosceles if any two (but no more than two) sides are equal, and scalene if no two sides are equal. A triangle will be input