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
Depreciation to a Salvage Value of 0.   For tax purposes an item may be depreciated over a period of several years, n. With the straight-line method of depreciation, each year th

If Then Else: The control statement If Then Else is used for computing a condition and taking the action based on the condition. If the condition is true then the section will

Write a XML with database with book details (BOOK ID, Title, Author, subject, published Year, language, vendor, price)

For reason of readability & consistency, employ the following prefixes along with descriptive names for variables in your VBScript code. S ub type Prefi

Adding Handlers With Class Wizard: Whenever a handler is added, the class wizard places the prototype for the message handler in the header (.H) file. It gives a skeleton hand

sir , i need visual basic form design & coding for Reynolds number & type of flow .

create an application that performs the following operation with the employee file created by the application in programming challenge 1: uses an open dialog box to allow the user

GENETICS 1.         The branch genetics started in 1900 after rediscovery of Mendel's work. 2.         Gregor Johann Mendel is called Father of genetics. 3.         The t

Dialog Based Application: The application which app wizard generates is based on the dialog template resource.

IMAGELIST The CImageList object is a collection of the same sized images, all of which can be referred to by its index. The ImageList are used to proficiently manage the large