65.9K
CodeProject is changing. Read more.
Home

Elongated Buttons, Rounded cornered Groupboxes and Labels of Trapeziums Shaped

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.77/5 (29 votes)

Dec 5, 2003

viewsIcon

92113

downloadIcon

4528

This article shows how to create elongated buttons, rounded cornered groupboxes and labels of trapezium shape

Sample screenshot

Introduction

This is a article as to how to create buttons, groupboxes and labels of different shapes using different GDI+ Functions. This example uses GraphicsPath() functions and others. To Create  Elongated buttons, Rounded cornered groupbox and Trapezium labels we are using the a GrahicsPath() object and added a semicircle to the left and right and a rectangle in between for the elongated shape. To Create a trapezium shape for the labels I have used the client rectangle and created a polygon with points to the three corners of the clientrectangle and the top right corner i have reduced the width by 20 pixels. for the drop shadow labels i have got shadow colors by using alpha index of black colors and written the text as many times as the shadow length is specified increasing the left and top position by 1 pixels for each iteration. Also used control's Region Property to specify non regular shaped i.e. non rectangular shape of the control.