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


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);


//BOOL GetClientRect(LPRECT lpRect) const



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
Question 1 Write about the Visual Basic Application Development Life cycle with a sample Forms development for performing integer arithmetic operations Question 2 Discuss the

DYNAMIC LINK LIBRARY   The dynamic link library (dll) permits one copy of a function to be shared among some parallel executing programs. The dll is a file that contains a num

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

Visual Interface  Based On Visual Patterns: The visual user interface should create recognizable patterns and text will be used for differentiating the objects with similar pa

Using Loops to Repeat Code Looping let you to run a group of statements repeatedly. Some loops repeat statements till a condition are False; others repeat statements till a con

Files in a SDI and MDI Application: Both the SDI and MDI projects have 4 implementation files (.cpp extension). These are the files equivalent to the Document Class, View Clas


Record Set: The record set presents the records in a base table or the records retrieved due to the query. The record set falls into 3 classes. These are table type record set

Associating Toolbars for the menu: 1. Insert the tool bar control to your form. 2. Now follow the steps to append the tool bar control to your form. 3. Then, Right Click

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