Make Controls Appear 3-D

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:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes