paxdom.blogg.se

How to build octagon windows
How to build octagon windows










how to build octagon windows

The above example creates two shaped PictureBoxes and a stretched hexagon shaped button!! If the containing area is square you end up with a circle, otherwise you will get a pointed oval. If NumberOfSides With a version of the code below this post the minimum is now 2 sides. Optional ByVal OffsetAngleInDegrees As Double = 0) Optional ByVal NumberOfSides As Integer = 3, _

how to build octagon windows how to build octagon windows

Public Sub Shape( ByVal ctrl As Control, _ Public Const DegreesToRadians As Double = 180 / Pi Or vice-versa than the regular shape is stretched to fit this shape.įrom the PROJECT menu using VB.Net 2008 or a later version select If the dotted rectangle ( that the control is drawn out within ) is wider than it is tall So if you have a square control like a square button or picturebox, you will get a regular shape. Into the shape you want within the bounds of the original shape of the control. Well using just one line of code you can transform any of your controls This led to creating the following code which acts on the base class CONTROLfor ALL controls!! Saw a post earlier which reminded me about Extension Methods. This will allow you all to suggest any changes, however small. This document was originally published as an MSDN discussion here on September 3rd, 2009












How to build octagon windows