Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PropertyBag Problem?
Message
From
05/05/2003 13:21:20
Adrian Demaestri
Ministerio de Economia de La Prov. de Ba
La Plata, Argentina
 
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00783792
Message ID:
00785032
Views:
26
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
Map
View

Click here to load this message in the networking platform