Results 1 to 2 of 2

Thread: activex doubts.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    21

    Post

    How to create properties page using the menu item Add - property page.

    One more Question!
    I have problem in adding the font property to my user control. The font does not change when i change the font property (created by me) in the user control
    I hev a textbox text1 in my user control

    Public Property Get txtfont() As font
    Set txtfont = UserControl.font
    End Property

    Public Property Set txtfont(ByVal vNewValue As font)
    Set UserControl.font = vNewValue
    Text1.font = UserControl.font
    PropertyChanged "txtfont"
    End Property

    Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    On Error Resume Next
    Set txtfont = PropBag.ReadProperty("txtfont")
    End Sub

    Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
    PropBag.WriteProperty "txtfont", txtfont
    End Sub

    In the form where i placed my usercontrol
    the code i placed is

    usercontrol11.txtlabel.name= "wingdings"
    it does not work..



  2. #2
    Registered User
    Join Date
    Apr 1999
    Location
    Brazil
    Posts
    144

    Post

    To create a new property Page you use this menu and select the "VB Porperty Page Wizard" and it 'll do the hard code so you'll be able to do a fine code.

    The other problem


    1) I suggest you to delete this code:

    Public Property Get txtfont() As font
    Set txtfont = UserControl.font
    End Property

    Public Property Set txtfont(ByVal vNewValue As font)
    Set UserControl.font = vNewValue
    Text1.font = UserControl.font
    PropertyChanged "txtfont"
    End Property

    Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    On Error Resume Next
    Set txtfont = PropBag.ReadProperty("txtfont")
    End Sub

    Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
    PropBag.WriteProperty "txtfont", txtfont
    End Sub


    2) With the add-in "ActiveX Control Interface Wizard" create a property called "txtfont" after that in the page wizard called "Set Mapping" you can associate your "txtFont" with a control of you usercontrol.

    3) In the Private "Sub UserControl_ReadProperties(PropBag As PropertyBag)"

    a) If you have other controls that need receive the
    font then set it

    Set lblOther = lblMAPPED_CONTROL.font

    I guess that this 'll help
    I you have any questions, please let me konw

    Jefferson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width