Autor Tema: Alinear picture dentro de un uC  (Leído 2599 veces)

0 Usuarios y 1 Visitante están viendo este tema.

E N T E R

  • Petabyte
  • ******
  • Mensajes: 1062
  • Reputación: +57/-13
  • www.enterpy.com
    • Ver Perfil
    • www.enterpy.com
Alinear picture dentro de un uC
« en: Noviembre 01, 2012, 09:27:37 pm »
Hola amigos necesito una manito. Quiero alinear un control Picture que tengo dentro de un UserControl de izquierda a derecha

Quiero ponerle una propiedad como esta:



Y que al darle una de las propiedades me alinee





Source
http://www.mediafire.com/?6sv03tn74ro0rab
CIBER GOOGLE - CONCEPCIÓN PARAGUAY
www.enterpy.com
Primera regla de la programacion, para que vas a hacerlo complicado si lo puedes hacer sencillo

LeandroA

  • Administrador
  • Petabyte
  • *****
  • Mensajes: 1128
  • Reputación: +151/-8
    • Ver Perfil
Re:Alinear picture dentro de un uC
« Respuesta #1 en: Noviembre 01, 2012, 10:39:36 pm »
Hola enter para eso se utlizan las propiedades Enum, te pongo un ejemplo despues vos codificas el resto


Código: (Vb) [Seleccionar]
Public Enum eAlinear
    [Izquierda]
    [Derecha]
End Enum

Private m_Alinear As eAlinear

Public Property Get Alinear() As eAlinear
    Alinear = m_Alinear
End Property


Public Property Let Alinear(Value As eAlinear)
    m_Alinear = Value
    If m_Alinear = Izquierda Then
        'picture1.Left = 0
        'text1.Left = pictue1.Width
    Else
        'picture1.Left = text1.Width
        'text1.Left = 0
    End If
    PropertyChanged ("Alinear")
End Property

E N T E R

  • Petabyte
  • ******
  • Mensajes: 1062
  • Reputación: +57/-13
  • www.enterpy.com
    • Ver Perfil
    • www.enterpy.com
Re:Alinear picture dentro de un uC
« Respuesta #2 en: Noviembre 05, 2012, 05:08:42 pm »
Perfecto Leandro, ahora tengo otro problemita al iniciar la aplicación no guardar la posicion, o sea si le asigno alinear a la derecha al iniciar se va otra ves a la izquierda.

Ajunto el proyecto:
http://www.mediafire.com/?uvz866xmcwxx141
« última modificación: Noviembre 05, 2012, 05:47:50 pm por E N T E R »
CIBER GOOGLE - CONCEPCIÓN PARAGUAY
www.enterpy.com
Primera regla de la programacion, para que vas a hacerlo complicado si lo puedes hacer sencillo

LeandroA

  • Administrador
  • Petabyte
  • *****
  • Mensajes: 1128
  • Reputación: +151/-8
    • Ver Perfil
Re:Alinear picture dentro de un uC
« Respuesta #3 en: Noviembre 05, 2012, 05:47:30 pm »
Hola seguramente no agregaste WriteProperty y ReadProperty o bien cuado haces ReadProperty, no ejecutas las comprobaciones, proba asi

Citar
   
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
   
    With PropBag
     
      m_OnlyNumbers = .ReadProperty("SoloNumeros", False)
      m_NumbersPoint = .ReadProperty("ActivarMillar", False)
      m_SoloLetras = .ReadProperty("SoloLetras", False)
      m_TodoLimit = .ReadProperty("TodoLimit", False)
     
      xFocus = .ReadProperty("HabilitarFoco", True)
     
      Set txtRaiz.Font = .ReadProperty("Font", Ambient.Font)
      txtRaiz.ForeColor = .ReadProperty("ForeColor", vbButtonText)
      txtRaiz.MaxLength = .ReadProperty("MaxLength", 0)
      txtRaiz.Locked = .ReadProperty("Locked", False)
      txtRaiz.Enabled = .ReadProperty("Enabled", True)
      txtRaiz.Text = .ReadProperty("Text", "")
      BackColor = .ReadProperty("BackColor", m_def_BackColor)
      Alignment = .ReadProperty("Alignment", m_def_Alignment)
      Me.Alinear = .ReadProperty("Alinear", Izquierda)
    End With
   
End Sub

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
   
    With PropBag
       
       .WriteProperty "SoloNumeros", m_OnlyNumbers, False
       .WriteProperty "ActivarMillar", m_NumbersPoint, False
       .WriteProperty "SoloLetras", m_SoloLetras, False
       .WriteProperty "TodoLimit", m_TodoLimit, False
       
       .WriteProperty "HabilitarFoco", xFocus, True
       
       .WriteProperty "Font", txtRaiz.Font, Ambient.Font
       .WriteProperty "ForeColor", txtRaiz.ForeColor, vbButtonText
       .WriteProperty "MaxLength", txtRaiz.MaxLength, 0
       .WriteProperty "Locked", txtRaiz.Locked, False
       .WriteProperty "Enabled", txtRaiz.Enabled, True
       .WriteProperty "Text", txtRaiz.Text, ""
       .WriteProperty "BackColor", m_BackColor, m_def_BackColor
       .WriteProperty "Alignment", m_Alignment, m_def_Alignment
       .WriteProperty "Alinear", m_Alinear, Izquierda
    End With
   
End Sub

E N T E R

  • Petabyte
  • ******
  • Mensajes: 1062
  • Reputación: +57/-13
  • www.enterpy.com
    • Ver Perfil
    • www.enterpy.com
Re:Alinear picture dentro de un uC
« Respuesta #4 en: Noviembre 05, 2012, 05:53:14 pm »
De lujo leandro ahi esta solucionado me faltaba hacer eso. Muchas gracias.
CIBER GOOGLE - CONCEPCIÓN PARAGUAY
www.enterpy.com
Primera regla de la programacion, para que vas a hacerlo complicado si lo puedes hacer sencillo