VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



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

by Brian Hoffleith (1 Submission)
Category: Graphics
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Thu 27th January 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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

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




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

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

No comments have been posted about This code will give a great effect to any control making the user interface much more professional. Why not be the first to post a comment about This code will give a great effect to any control making the user interface much more professional.

Post your comment

Subject:
Message:
0/1000 characters