Ver Mensaje Individual
  #6 (permalink)  
Antiguo 18/01/2008, 09:44
Avatar de seba123neo
seba123neo
 
Fecha de Ingreso: febrero-2007
Ubicación: Esperanza, Santa Fe
Mensajes: 1.046
Antigüedad: 17 años, 3 meses
Puntos: 19
Re: generar sombras en un Form.

hola,no se como lo estas haciendo pero el codigo seria asi para solo los textbox..

Código:
Option Explicit

Const ANCHO_SOMBRA As Integer = 5
Const COLOR_SOMBRA As Long = &H808080


Private Sub Form_Paint()

Dim El_Control As Control
Dim Contenedor As Object

For Each El_Control In Me.Controls

    Set Contenedor = El_Control.Container

    If TypeOf El_Control Is TextBox Then

       Call Generar_Sombra(Contenedor, El_Control, ANCHO_SOMBRA, COLOR_SOMBRA)
    
    End If

Next

If Not El_Control Is Nothing Then
   El_Control = Nothing
End If

End Sub

Private Sub Generar_Sombra(El_Contenedor As Object, _
                           El_Control As Control, _
                           Grosor_Sombra As Integer, _
                           COLOR_SOMBRA As Long)
    
    Dim X As Single
    Dim Y As Single
    Dim Ancho As Single
    Dim Alto As Single
    
    Dim Escala As Integer
    Dim Grosor As Integer
    

    Grosor = El_Contenedor.DrawWidth
    Escala = El_Contenedor.ScaleMode
    
    El_Contenedor.DrawWidth = 1
    El_Contenedor.ScaleMode = vbPixels

    X = El_Control.Left + Grosor_Sombra
    Y = El_Control.Top + Grosor_Sombra

    Ancho = El_Control.Width - 1
    Alto = El_Control.Height - 1

    El_Contenedor.Line (X, Y)-Step(Ancho, Alto), COLOR_SOMBRA, BF

    El_Contenedor.ScaleMode = Escala
    El_Contenedor.DrawWidth = Grosor
    
End Sub
saludos.
__________________
" Todos Somos Ignorantes; lo que pasa es que no todos ignoramos las mismas cosas " - Albert Einstein