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
Do While Loop Statement : The statements contained by the do...while loop block executes till the condition given in the while is true. The working of do...loop is elaborate

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

Do Until Loop Statement: The statements within the do...until loop block executes till the condition given in until become true. The working of do...until loop is elaborated w

'This program compares interest rates between two banks and determines the best bank PublicClassForm1 PrivateSub Button1_Click(sender AsSystem.Object, e AsSystem.EventArgs) H

#question.algorithemtofindwhetheragivennumberisprime/not.

I would like to know how to deploy a VB.NET Application using SQL SERVER as a back-end database

For ..... Next Repetition Statement: To demonstrate the working of for .. next control statement, put a command button and a label control on the form. The Handle clicks the e

Mostly time, you just desire to assign a single value to a variable you have declared. A variable having a single value is a scalar variable. At other times, this is convenient to

GDI OBJECTS   The CDC provides 5 versions for the GDI objects. They are fonts, brushes, pens, bitmaps and regions. The Select Object function substitutes the current GDI objec

ODBC   The ODBC gives an API which distinguishes the data base vendors implementation via the ODBC drivers specific to a DBMS. The program will use the API to call the ODBC dr