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

Assignment Help:

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


Related Discussions:- Steps to create a rectangle in the client region

For next repetition - control statement, For ..... Next Repetition Statemen...

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

Programming, i have connected my visual basic 2010 express in ports and use...

i have connected my visual basic 2010 express in ports and use it to send sms but it failed... now my teacher said that i have to use my LAN not port to send it instead..... please

Function procedures - vbscript, This is a series of VBScript statements enc...

This is a series of VBScript statements enclosed through the Function & End Function statements. A Function procedure is same to a Sub procedure, however can also return a value. T

Properties of object method, Properties: VBScript Err Object ...

Properties: VBScript Err Object   Properties   Description   D escription Property The descriptive string related

Precompiled header file, THE PRECOMPILED HEADER FILE As soon as you gen...

THE PRECOMPILED HEADER FILE As soon as you generate a blank project, ahead of doing any coding you compile the project to generate .pch (that is the pre compiled header) file a

Introduction to database applications , INTRODUCTION TO DATABASE APPLICATIO...

INTRODUCTION TO DATABASE APPLICATIONS   In this section, we define a dialog and tab order that is the order in which the controls will be navigated during the execution. The D

XML with database, write a XML with database with book details( book id, au...

write a XML with database with book details( book id, author ,subject, published year, vendor,price, language )

Visual Basic 2010 by Julia Case Bradley and Anita C. Millspa, - I have the ...

- I have the chapter 5 project completed already. This is due tomorrow. Modify the Very Very .Boards project from Chapter 5 to separate the user interface from the business logic.

Scalar variables and array variables, Mostly time, you just desire to assig...

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

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd