General information
Category:
Coding, syntax & commands
A little out of date but...
Heres some code of my control that use the value of "mostrarbotones" to show or hide some buttons on it. :
'mostrarbotones means showbuttons
Private vMostrarBotones As Boolean
Public Property Get MostrarBotones() As Boolean
MostrarBotones = vMostrarBotones
End Property
Public Property Let MostrarBotones(ByVal valor As Boolean)
vMostrarBotones = valor
cmdder.Visible = valor
cmdizq.Visible = valor
cmdsig.Visible = valor
cmdant.Visible = valor
CmdBusc.Visible = valor
Lbl_cantimg.Visible = valor
'here is where I chenge the view of the control based on the value of mostrarbotones
' I think you should change the colors just here
If valor Then
imagen.Width = UserControl.ScaleWidth
imagen.Height = Abs(UserControl.ScaleHeight - (cmdder.Height * 1.2))
cmdant.Top = Abs(UserControl.ScaleHeight - (cmdder.Height * 1.1))
cmdsig.Top = Abs(UserControl.ScaleHeight - (cmdder.Height * 1.1))
cmdizq.Top = Abs(UserControl.ScaleHeight - (cmdder.Height * 1.1))
cmdder.Top = Abs(UserControl.ScaleHeight - (cmdder.Height * 1.1))
CmdBusc.Top = Abs(UserControl.ScaleHeight - (cmdder.Height * 1.1))
Lbl_cantimg.Top = Abs(UserControl.ScaleHeight - (cmdder.Height * 1.1))
Else
imagen.Width = UserControl.ScaleWidth
imagen.Height = UserControl.ScaleHeight
End If
End Property
Private Sub UserControl_InitProperties()
MostrarBotones = True 'default value
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
MostrarBotones = PropBag.ReadProperty("mostrarbotones")
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "mostrarbotones", vMostrarBotones
End Sub
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only