Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: E N T E R 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:
(http://www.mediafire.com/conv/e3999d908af256327f528099ec559a3d897672f07ea32166a633eae2159d17a04g.jpg) (http://www.mediafire.com/view/?2kdgs75uqtmu85j)
Y que al darle una de las propiedades me alinee
(http://www.mediafire.com/conv/00a8a8a0847e833ab222d3d80bf9dcf1f8f9bc72f5fda2315d5d2e92a73acfc24g.jpg) (http://www.mediafire.com/view/?si76mv7nb34jcat)
(http://www.mediafire.com/conv/5fc4c056cbe7feb1ea1d047da4789c509920d0892d64d187d5e8875485e7ce8d4g.jpg) (http://www.mediafire.com/view/?dxfy63hpmwwpvxp)
Source
http://www.mediafire.com/?6sv03tn74ro0rab
-
Hola enter para eso se utlizan las propiedades Enum, te pongo un ejemplo despues vos codificas el resto
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
-
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
-
Hola seguramente no agregaste WriteProperty y ReadProperty o bien cuado haces ReadProperty, no ejecutas las comprobaciones, proba asi
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
-
De lujo leandro ahi esta solucionado me faltaba hacer eso. Muchas gracias.