Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: A difficult problem when implementing my user control.


Message #1 by "Raymond Lo" <ytlo@n...> on Wed, 31 Jan 2001 08:14:18 -0000
Dear Sir,
      I drawn four lines to get my own button. At DESIGN TIME OF THE USER
CONTROL, the lines of the button are enabled and visabled.
      I made a property called 'Appearance'. It consists of two choices:
[borderless] and [with border].
      I want the button to be invisable at run-time initially. Hence in a
new form, I dragged and dropped the new created button in the form. The
property 'Appearance' of the button was set to borderless. Here is key
code :

....
Public Property Let Appearance(ByVal New_Appearance As ButtApp)
    Select Case New_Appearance
        Case ButtApp.[With Border]
            ButtBordStat 'A subroutine to MAKE FOUR LINES VISABLE
        Case ButtApp.Borderless
            ButtBordLessStat 'A subroutine to MAKE FOUR LINES INVISABLE
    End Select
    m_Appearance = New_Appearance
    PropertyChanged "Appearance"
End Property
....


      At DESIGN TIME OF THE FORM, I can get the result. When I set the
'Appearance' of the new created button to be [borderless], it executed the
subroutine 'ButtBordLessStat' to make the lines (button) invisable.
     However, when I run the form, it gives the button which is the same
as the button I created in my user-control project (all four lines
visable). Although I added the following code in the
'usercontrol_initialize' subroutine, I cannot get the result. Here is the
code:

....
Private Sub UserControl_Initialize()
    Select Case Appearance
        Case [With Border]
            ButtBordStat 'A subroutine to MAKE FOUR LINES VISABLE
        Case Borderless
            ButtBordLessStat 'A subroutine to MAKE FOUR LINES INVISABLE
    End Select
End Sub
....

     I would be appreciated if you could grant me a solution on how to
solve the above problem. Many thanks in advance.

Thanks and best regards.

Raymond.

  Return to Index