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
PROJECT TO CREATE SPLITTER WINDOW   1. Generate the SDI application. 2. Enlarge the class tab page. 3. Select the view class. 4. On right clicking the menu pops up.

Fixed length strings: The Fixed length strings are declared by identifying the size of the string. For illustration to give a length of 20 for the string place, the declarati

FILE SYSTEM CONTROLS There are 3 file system controls as shown in figure. The drive list box, directory list box & the file list box. The drive list box control is used to exhi

steps of connecting database from vb6.0

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

Question 1 Create a VB application to make the text bold, italic, underlined and also color the text (using checkbox, option button, textbox controls) Question 2 Create a

Write a program that permits the user to order a product from inventory. The user selects the product and enters the quantity. If there is sufficient quantity on hand of the produc

Tab Order: The tab order stands for the order in which the controls receive focus when the user clicks the tab key. The CTRL + D can be used to set the tab order of controls.

A program is needed to assist computing automobile repair bills. The cost of labor is $35 per hour. The costs for parts are subject to a 5% sales tax, which should be added t

You declare variables explicitly in script via the Dim statement, the Public statement, & the Private statement. For illustration: Dim DegreesFahrenheit You declare multiple