VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Professional look

by Faisal Arif (6 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

This code will give a great effect to any control making the user interface much more professional

Rate Professional look

Option Explicit
Private Sub Command1_Click()
'Create a shadow to the right and below of Text1 (TextBox)
Shadow Me, Text1
End Sub
Private Sub Shadow(fIn As Form, ctrlIn As Control)
Const SHADOW_COLOR = &H40C0& 'Shadow Color
Const SHADOW_WIDTH = 3 'Shadow Border Width
Dim iOldWidth As Integer
Dim iOldScale As Integer
'Save the current DrawWidth and ScaleMode
iOldWidth = fIn.DrawWidth
iOldScale = fIn.ScaleMode
fIn.ScaleMode = 3
fIn.DrawWidth = 1
'Draws the shadow around the control by drawing a gray
'box behind the control that's offset right and down.
fIn.Line (ctrlIn.Left + SHADOW_WIDTH, ctrlIn.Top + _
      SHADOW_WIDTH)-Step(ctrlIn.Width - 1, _
      ctrlIn.Height - 1), SHADOW_COLOR, BF
'Restore Old Setting
fIn.DrawWidth = iOldWidth
fIn.ScaleMode = iOldScale
End Sub

Download this snippet    Add to My Saved Code

Professional look Comments

No comments have been posted about Professional look. Why not be the first to post a comment about Professional look.

Post your comment

Subject:
Message:
0/1000 characters