CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 1999
    Location
    Tokyo, Japan.
    Posts
    57

    Properties of User Control

    How can I expose a Design-Time only property of a constituent control in my User Control?

    I have made a user control consisting of a combo box. I want to expose the Sorted property of the combo box. How can I do this?

    Sorted property of the combo box is a Design-time only property.

    Any help is grately appreciated.

    Thanx,
    Jagadish.


  2. #2
    Join Date
    Aug 2000
    Location
    Ottawa, Canada
    Posts
    469

    Re: Properties of User Control

    I'm sure you can do it if you're creating OCX (because I've done the same in my OCX-control).
    Use ActiveX Control Interface Wizard.


  3. #3
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Properties of User Control

    As far as I know, a constituent control is always in run time mode, because it is running in your control.

    In most cases design time only properties are such because they are things that can only be set when a window is being created as is the case with the sorted property.

    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  4. #4
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Properties of User Control

    I would create a Property Get in the UserControl that returns the value of the .Sorted Property of the comboBox, something like this:

    public property get SortValue() as Boolean
    SortValue = Combo1.Sorted
    End property




    John G

  5. #5
    Join Date
    May 1999
    Location
    Tokyo, Japan.
    Posts
    57

    Re: Properties of User Control

    I am creating an OCX control!!

    I used the ActiveX control Interface wizard to add the properties to my user control. Only the Get method for .Sorted property is added by the wizard.

    If u have done the same b4, could u send me some sample code?

    Thanx,
    Jagadish.


  6. #6
    Join Date
    May 1999
    Location
    Tokyo, Japan.
    Posts
    57

    Re: Properties of User Control

    I want to add the Set interface for .Sorted Property of the combo box.

    If I add a Set interface, I get a run-time error saying the property is read-only.


  7. #7
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Properties of User Control

    You can't change the .Sorted property at run time. This is a ComboBox control restriction.

    John G

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

Featured