Make Controls Appear 3-D

The latest trend in Windows programs is the use of a 3-D look thatmakes windows and controls appear to be three-dimensional. As a result,a number of tools for adding the 3-D look to VB applications are available.One of the most popular is THREED.VBX, which ships with the professionaledition of VB 3.0. Adding more VBXs or DLLs to your program just to enhance your program’slook, however, may seem like overkill. The Apply3D routine shows how tomake a control such as a text box appear sunken or recessed. Apply3D worksby painting dark gray lines along the left and top sides of the control,and light gray lines along the bottom and right sides. This gives the controlthe appearance of being recessed. Note that the routine does not paintinside of the control.

 Sub Apply3D (myForm As Form, myCtl As Control) 'Make specified control "sunken" 'This routine assumes that the mapping mode 'for myForm is 3-pixel myForm.CurrentX = myCtl.Left - 1 myForm.CurrentY = myCtl.Top + myCtl.Height myForm.Line -Step(0, -(myCtl.Height + 1)), _ RGB(92, 92, 92) myForm.Line -Step(myCtl.Width + 1, 0), _ RGB(92, 92, 92) myForm.Line -Step(0, myCtl.Height + 1), _ RGB(255, 255, 255) myForm.Line -Step(-(myCtl.Width + 1), 0), _ RGB(255, 255, 255) End Sub 

You’ll need to set the form’s BackColor to gray (&H00C0C0C0&)and set the ScaleMode property to 3–Pixel. To use the Apply3D routine,call it from the form’s Paint event. For example, this code shows whatthe Paint event would look like if you had two text boxes (Text1 and Text2)that you want to show in 3-D:

 Sub Form_Paint () Call Apply3D(Me, Text1) Call Apply3D(Me, Text2) End Sub 
Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

iOS app development

The Future of iOS App Development: Trends to Watch

When it launched in 2008, the Apple App Store only had 500 apps available. By the first quarter of 2022, the store had about 2.18 million iOS-exclusive apps. Average monthly app releases for the platform reached 34,000 in the first half of 2022, indicating rapid growth in iOS app development.

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a