VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Various Techniques For Initializing Properties To Default Values In The Initproperties Event Proced

by Freetutes.com (3 Submissions)
Category: OLE/COM/DCOM/Active-X
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 6th January 2009
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Various Techniques For Initializing Properties To Default Values In The Initproperties Event Procedure

Rate Various Techniques For Initializing Properties To Default Values In The Initproperties Event Proced



Private Const defCelsius = 30
Private m_TemperatureDate As Date
Private m_Celsius As Single
Private m_Caption as String

Private Sub UserControl_InitProperties()
   'Set temperaturedate to a value
   'determined right here
   m_TemperatureDate = DateSerial(1997, 1, 1)
   'Set Celsius to a default
   'constant value
   m_Celsius = defCELSIUS
   'Compute Fahrenheit from that
   RecalcFahrenheitFromCelsius m_Celsius
   'Set the Background color to
   'match the container's background
   BackColor = Ambient.BackColor
   'Set the caption to be the
   'same as the object's initial name
   'm_Caption = Extender.Name
   'and set Slider to reflect temperature
   Slider1.Value = m_Celsius
   'and textbox to match date
   txtDate.Text = m_TemperatureDate
End Sub

Download this snippet    Add to My Saved Code

Various Techniques For Initializing Properties To Default Values In The Initproperties Event Proced Comments

No comments have been posted about Various Techniques For Initializing Properties To Default Values In The Initproperties Event Proced. Why not be the first to post a comment about Various Techniques For Initializing Properties To Default Values In The Initproperties Event Proced.

Post your comment

Subject:
Message:
0/1000 characters