|
|
|
|
|
Dicas
|
|
Visual Basic (Forms/MDI)
|
|
|
Título da Dica: Inserindo sombra em objetos do form
|
|
|
|
Postada em 22/11/2000 por Adriano
adriano.faria@bol.com.br
'*** Módulo BAS Global Const GFM_STANDARD = 0 Global Const GFM_RAISED = 1 Global Const GFM_SUNKEN = 2
Global Const GFM_BACKSHADOW = 1 Global Const GFM_DROPSHADOW = 2
Global Const BOX_WHITE& = &HFFFFFF Global Const BOX_LIGHTGRAY& = &HC0C0C0 Global Const BOX_DARKGRAY& = &H808080 Global Const BOX_BLACK& = &H0&
'*** SUB no Módulo BAS Sub FormControlShadow(f As Form, C As Control, shadow_effect As Integer, shadow_width As Integer, shadow_color As Long)
Dim shColor As Long Dim shWidth As Integer Dim oldWidth As Integer Dim oldScale As Integer shWidth = shadow_width shColor = shadow_color oldWidth = f.DrawWidth oldScale = f.ScaleMode f.ScaleMode = 3 'Pixels f.DrawWidth = 1 Select Case shadow_effect Case GFM_DROPSHADOW f.Line (C.Left + shWidth, C.Top + shWidth)-Step(C.Width - 1, C.Height - 1), shColor, BF Case GFM_BACKSHADOW f.Line (C.Left - shWidth, C.Top - shWidth)-Step(C.Width - 1, C.Height - 1), shColor, BF End Select f.DrawWidth = oldWidth f.ScaleMode = oldScale
End Sub
'*** FORM_PAINT
FormControlShadow Me, Text1, GFM_DROPSHADOW, 4, QBColor(8) FormControlShadow Me, Frame1, GFM_DROPSHADOW, 4, QBColor(8) FormControlShadow Me, Combo1, GFM_DROPSHADOW, 4, QBColor(8) FormControlShadow Me, Command1, GFM_DROPSHADOW, 4, QBColor(8)
'***O nr. 4 na chamada da função, se refere à espessura da sombra.
|
|
|
|
|