Click here to Skip to main content
Click here to Skip to main content

Property list ActiveX control

, 4 Nov 2004
Rate this:
Please Sign up or sign in to vote.
Property list similar to VB.NET, implemented as ActiveX control.

Sample Image - propList.gif


The article is updated! See below for the changes!


This property list control is similar to other property lists available, with two main differences:

  1. It's very easy to implement.
  2. It's implemented as an ActiveX control, so it's suitable for C++, C#, and VB as one. Also, it can be placed on an HTML page or any other container that supports ActiveX and script.


  • BorderStyle As BorderStyle

    The border style of the control.

    BorderStyle enum:

    • BorderNone = 0 - No border
    • BorderRaized = 1 - EDGE_RAISED
    • BorderSunken = 2 - EDGE_SUNKEN
    • BorderStatic = 4 - BDR_SUNKENINNER
  • Precision As Short

    Overall precision of double values (* not used at the moment).

  • Clear()

    Clears all the properties from control.

  • AddProperty(BSTR Category, BSTR Caption, VARIANT Value, BSTR Description, buttonType ButtonType,VARIANT_BOOL IsEnabled)

    Adds new property to the control.

    • Category - the category of the property.
    • Caption - the caption (the string name of the property).
    • Value - the property value (String, Short, Long, String array, DateTime, Picture etc...).
    • Description - the text to display in the description window.
    • ButtonType - the button type of the property (* applicable to edit controls, and DateTime control).
    • IsEnabled - is the property enabled.

    ButtonType enum:

    • ButtonNone = 0 - no button
    • ButtonElipsis = 1 - ellipsis button (three dots), edit control created.
    • ButtonPick = 2 - pick button (arrow with x), edit control created.
    • ButtonOpen = 3 - button opens a file open dialog, edit control created.
    • ButtonLink = 4 - button opens the Explorer, edit control created.
    • ButtonColor = 5 - button opens pick color dialog, color control created.
    • ButtonMail = 6 - button opens new mail message, edit control created.
    • ButtonLongDate = 7 - displays a date in long format, DateTime control created.
    • ButtonShortDate = 8 - displays a date in short format, DateTime control created.
    • ButtonTime = 9 - displays a time, DateTime control created.
  • SetValue(BSTR PropertyName, VARIANT Value)

    Sets a value for single property.

    • PropertyName - the name of the property to set the value for.
    • Value - the value to set.
  • PropertyChanged(BSTR PropertyName, VARIANT NewValue)

    Fired on property change.

    • PropertyName - the name of the property that changed.
    • NewValue - the new value.
  • ButtonClicked(BSTR PropertyName, short ButtonType, VARIANT* Value)

    Fired on button click allowing you to perform some custom action for the button, and set the value to a new one as the result of performed actions.

    • PropertyName - the name of the property whose button was clicked.
    • ButtonType - the type of the button.
    • Value - passed ByRef (as pointer) allowing you to set a new value on function return.

* Note that some of the controls have a default action for button click, as the color button, linkbutton, mail button etc...


Update - 04/11/2004

New Properties
  • ShowDescription As Boolean

    Controls display of the description (True/False).

New Methods
  • CloseAll()

    Closes all the categories (useful if you'd like to start the list when all the categories are closed. You can fill the list then call CloseAll() to close the categories).

New button types
  • ButtonMultyText = 10 - Creates a text window five rows high for multiple lines text.
  • ButtonButton = 11 - Creates a button which occupies the entire row.
  • ButtonFunction = 12 - Creates a property whose value is calculated from the provided function which may be based on other properties. For example:

    You have a property named Diameter and its value is 10. You add a function type property named area, click on its button, the "Enter function" dialog appears where you write - 3.14 * ([Diameter]/2)^2. After you close the dialog, the value displayed in the property would be: 78.5. If you now change the Diameter to 4, the Area property will automatically update to 12.56.

  • ButtonPicture = -1 - The passed string is a path to an image file (you can also pass images as IDispatch interface).


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Alex Hazanov
Software Developer (Senior) RDV Systems
Israel Israel
No Biography provided

Comments and Discussions

GeneralMy vote of 5 Pinmemberduke.liu8-Sep-11 0:15 
GeneralMy vote of 5 Pinmembermychina14-Mar-11 20:09 
GeneralDear sir,I have a question. Pinmemberking5524047019-Feb-11 23:44 
GeneralRe: Dear sir,I have a question. Pinmemberking5524047020-Feb-11 1:07 
GeneralRe: Dear sir,I have a question. PinmemberAlex Hazanov20-Feb-11 2:15 
GeneralMy vote of 5 Pinmember123456anurag27-Oct-10 21:53 
Generalusing the arrow keys to move thru list PinmemberSteve P13-Jun-08 14:01 
GeneralUsing SetValue for combobox Pinmemberdynal12-Jul-07 6:06 
GeneralRe: Using SetValue for combobox Pinmembercamalia7-Aug-07 15:18 
GeneralReally nice, some bugs/problems PinmemberPartyPaul19-Apr-07 4:47 
First bugs which i encountered so far:
In the CEditItem::OnKillFocus procedure there is no check for bChange to call Apply, so Apply ist called even if u press Escape and KillFocus is called.
For people that have problems (i.e. the german üäöß) with the displayed Font, the main font (created in CMyList::CMyList()) uses the HEBREW_CHARSET, change that to the charset u need (in normal case ANSI_CHARSET should do it.

I have a special problem and dont know if it's me or better my App, the VS 2003 Compiler, or a "Bug" in the Control.
I use c++ and mfc and create the control at runtime which is no problem.
For that I created a wrapper class derived from CWnd(similar to the one in the sample project), in my window (no dialog), where the control should be placed, i have a member variable of that class, the Eventprocedures and create with CreateControl the Control.
No problems so far, the control is created, it fires the Events correctly etc. BUT, the Edit Controls dont get the VK_ESCAPE and VK_RETURN. All other keys are send to the Control.
My problem is now who takes the message and kills it.
Hierarchy is -> Mainfrm -> Propertybar(customwnd) -> Propertysheet(customwnd) -> Wrapperclass with Control if it helps.
I tried for hours and didnt get another solution as described down or found the one who kills the message and send it not to the Control.
My Solution was in the Wrapperclass:PretranslateMessage() i get the VK_ESCAPE & VK_RETURN message with the correct handle of the Control. So at this point I send it directly to the Control.
What i really dont understand is that in the Control i dont get ANY PretranslateMessage Calls in any of the windows/classes, is that COM related or why isnt it fired. Where can i get the Message before it's translated/dispatched ?!
Next problem is, that if i create it at runtime in my app if i press the Escapekey in a Multilineeditcontrol, all items,but the description, in the Control are killed, and a heavy exception is fired as soon as the Control losts the Focus o_O. The Returnkey doesnt do anything.
That happens with or without my Pretranslate"hack".
It seems like the behaviour of OnOK and OnCancel, the question is where.
So i think there is anything in the Control who dispatches or translate the Enter and Escape Key to the wrong place, but because no pretranslate is called i dont know where to get in and search for it.
The strange is, that the Control in an VisualBasic (6.0) app hasn't that behaviour and functions so as u expect it. Can anyone help ?
GeneralRe: Really nice, some bugs/problems PinmemberPartyPaul19-Apr-07 5:41 
GeneralGreat, but .... PinmemberBui Tan Duoc6-Feb-07 15:49 
QuestionHow to add new column Pinmemberjeando200317-Oct-06 16:04 
Questionhow to set value to Property whose type is ComboBox PinmemberDnyaneshwar Kotwal10-Aug-06 20:16 
AnswerRe: how to set value to Property whose type is ComboBox PinmemberAlex Hazanov18-Aug-06 12:10 
QuestionHow can I set value of SAFEARRAY type PinmemberNabam12-Jul-06 0:27 
GeneralActiveX contol properties PinmemberAlton Williams10-May-06 5:44 
GeneralRe: ActiveX contol properties PinmemberAlex Hazanov22-May-06 3:02 
GeneralMy question answered: PinmemberAlton Williams30-May-06 5:33 
Generalbug : coud not redraw window valid Pinmembersillyemperor22-Jan-06 20:20 
QuestionJavascript combobox problems PinmemberCoMiKe14-Dec-05 3:51 
AnswerRe: Javascript combobox problems PinmemberAlex Hazanov14-Dec-05 5:57 
GeneralRe: Javascript combobox problems PinmemberCoMiKe14-Dec-05 14:16 
GeneralRe: Javascript combobox problems PinmemberCoMiKe15-Dec-05 2:54 
GeneralWell Done Pinmembervalladis16-Aug-05 4:14 
GeneralNice work Pinmembertbw6-Jul-05 4:21 
GeneralFile Open Filter PinmemberJohnNJC8-Jun-05 3:29 
GeneralRe: File Open Filter PinmemberAlex Hazanov8-Jun-05 10:43 
GeneralBug report Pinmemberalex_br13-Feb-05 0:08 
Generalproperty icon PinmemberNoJunk4Me15-Dec-04 4:32 
GeneralRe: property icon PinmemberAlex Hazanov15-Dec-04 9:48 
GeneralSpanish Support PinmemberMicroElias Corporation Framework6-Dec-04 7:28 
GeneralRe: Spanish Support PinmemberAlex Hazanov8-Dec-04 7:46 
GeneralRe: Spanish Support PinmemberLefteris2313-Dec-06 5:28 
QuestionLisence? PinmemberXGears20005-Dec-04 22:36 
AnswerRe: Lisence? PinmemberAlex Hazanov5-Dec-04 23:16 
GeneralGet PinmemberTactor5-Nov-04 4:10 
GeneralRe: Get PinmemberAlex Hazanov5-Nov-04 10:29 
GeneralRe: Get PinmemberTactor5-Nov-04 10:51 
QuestionRe: Get PinmembertroyLiu23-May-06 23:56 
AnswerRe: Get PinmembertroyLiu24-May-06 1:21 
AnswerRe: Get PinmemberAlex Hazanov30-May-06 7:18 
QuestionRe: Get PinmembertroyLiu25-May-06 4:46 
GeneralUPDATED! PinmemberAlex Hazanov4-Nov-04 23:38 
GeneralOther Cuestion (VB) PinmemberMicroElias Corporation Framework26-Oct-04 6:13 
GeneralRe: Other Cuestion (VB) PinmemberAlex Hazanov26-Oct-04 10:19 
GeneralRe: Other Cuestion (VB) PinmemberMicroElias Corporation Framework28-Oct-04 11:29 
GeneralRe: Other Cuestion (VB) PinmemberAlex Hazanov29-Oct-04 13:20 
GeneralRe: Other Cuestion (VB) PinmemberAlex Hazanov29-Oct-04 13:24 
GeneralRe: Other Cuestion (VB) PinmemberMicroElias Corporation Framework8-Nov-04 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150129.1 | Last Updated 5 Nov 2004
Article Copyright 2004 by Alex Hazanov
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid