Click to See Complete Forum and Search --> : Properties of User Control
jagadishkumar
August 13th, 2001, 09:06 PM
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.
Andrew R.
August 15th, 2001, 11:18 AM
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.
Clearcode
August 15th, 2001, 11:44 AM
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.
John G Duffy
August 15th, 2001, 01:04 PM
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
jagadishkumar
August 15th, 2001, 07:28 PM
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.
jagadishkumar
August 15th, 2001, 07:33 PM
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.
John G Duffy
August 16th, 2001, 08:06 AM
You can't change the .Sorted property at run time. This is a ComboBox control restriction.
John G
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.