Click here to Skip to main content
11,929,232 members (61,993 online)
Click here to Skip to main content
Add your own
alternative version


53 bookmarked

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

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
duke.liu8-Sep-11 0:15
memberduke.liu8-Sep-11 0:15 
GeneralMy vote of 5 Pin
mychina14-Mar-11 20:09
membermychina14-Mar-11 20:09 
GeneralDear sir,I have a question. Pin
king5524047019-Feb-11 23:44
memberking5524047019-Feb-11 23:44 
GeneralRe: Dear sir,I have a question. Pin
king5524047020-Feb-11 1:07
memberking5524047020-Feb-11 1:07 
GeneralRe: Dear sir,I have a question. Pin
Alex Hazanov20-Feb-11 2:15
memberAlex Hazanov20-Feb-11 2:15 
GeneralMy vote of 5 Pin
123456anurag27-Oct-10 21:53
member123456anurag27-Oct-10 21:53 
Generalusing the arrow keys to move thru list Pin
Steve P13-Jun-08 14:01
memberSteve P13-Jun-08 14:01 
GeneralUsing SetValue for combobox Pin
dynal12-Jul-07 6:06
memberdynal12-Jul-07 6:06 
GeneralRe: Using SetValue for combobox Pin
camalia7-Aug-07 15:18
membercamalia7-Aug-07 15:18 
GeneralReally nice, some bugs/problems Pin
PartyPaul19-Apr-07 4:47
memberPartyPaul19-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 Pin
PartyPaul19-Apr-07 5:41
memberPartyPaul19-Apr-07 5:41 
GeneralGreat, but .... Pin
Bui Tan Duoc6-Feb-07 15:49
memberBui Tan Duoc6-Feb-07 15:49 
QuestionHow to add new column Pin
jeando200317-Oct-06 16:04
memberjeando200317-Oct-06 16:04 
Questionhow to set value to Property whose type is ComboBox Pin
Dnyaneshwar Kotwal10-Aug-06 20:16
memberDnyaneshwar Kotwal10-Aug-06 20:16 
AnswerRe: how to set value to Property whose type is ComboBox Pin
Alex Hazanov18-Aug-06 12:10
memberAlex Hazanov18-Aug-06 12:10 
QuestionHow can I set value of SAFEARRAY type Pin
Nabam12-Jul-06 0:27
memberNabam12-Jul-06 0:27 
GeneralActiveX contol properties Pin
Alton Williams10-May-06 5:44
memberAlton Williams10-May-06 5:44 
GeneralRe: ActiveX contol properties Pin
Alex Hazanov22-May-06 3:02
memberAlex Hazanov22-May-06 3:02 
GeneralMy question answered: Pin
Alton Williams30-May-06 5:33
memberAlton Williams30-May-06 5:33 
Generalbug : coud not redraw window valid Pin
sillyemperor22-Jan-06 20:20
membersillyemperor22-Jan-06 20:20 
QuestionJavascript combobox problems Pin
CoMiKe14-Dec-05 3:51
memberCoMiKe14-Dec-05 3:51 
AnswerRe: Javascript combobox problems Pin
Alex Hazanov14-Dec-05 5:57
memberAlex Hazanov14-Dec-05 5:57 
GeneralRe: Javascript combobox problems Pin
CoMiKe14-Dec-05 14:16
memberCoMiKe14-Dec-05 14:16 
GeneralRe: Javascript combobox problems Pin
CoMiKe15-Dec-05 2:54
memberCoMiKe15-Dec-05 2:54 
GeneralWell Done Pin
valladis16-Aug-05 4:14
membervalladis16-Aug-05 4:14 
GeneralNice work Pin
tbw6-Jul-05 4:21
membertbw6-Jul-05 4:21 
GeneralFile Open Filter Pin
JohnNJC8-Jun-05 3:29
memberJohnNJC8-Jun-05 3:29 
GeneralRe: File Open Filter Pin
Alex Hazanov8-Jun-05 10:43
memberAlex Hazanov8-Jun-05 10:43 
GeneralBug report Pin
alex_br13-Feb-05 0:08
memberalex_br13-Feb-05 0:08 
Generalproperty icon Pin
NoJunk4Me15-Dec-04 4:32
memberNoJunk4Me15-Dec-04 4:32 
GeneralRe: property icon Pin
Alex Hazanov15-Dec-04 9:48
memberAlex Hazanov15-Dec-04 9:48 
GeneralSpanish Support Pin
MicroElias Corporation Framework6-Dec-04 7:28
memberMicroElias Corporation Framework6-Dec-04 7:28 
GeneralRe: Spanish Support Pin
Alex Hazanov8-Dec-04 7:46
memberAlex Hazanov8-Dec-04 7:46 
GeneralRe: Spanish Support Pin
Lefteris2313-Dec-06 5:28
memberLefteris2313-Dec-06 5:28 
QuestionLisence? Pin
XGears20005-Dec-04 22:36
memberXGears20005-Dec-04 22:36 
AnswerRe: Lisence? Pin
Alex Hazanov5-Dec-04 23:16
memberAlex Hazanov5-Dec-04 23:16 
GeneralGet Pin
Tactor5-Nov-04 4:10
memberTactor5-Nov-04 4:10 
GeneralRe: Get Pin
Alex Hazanov5-Nov-04 10:29
memberAlex Hazanov5-Nov-04 10:29 
GeneralRe: Get Pin
Tactor5-Nov-04 10:51
memberTactor5-Nov-04 10:51 
QuestionRe: Get Pin
troyLiu23-May-06 23:56
membertroyLiu23-May-06 23:56 
AnswerRe: Get Pin
troyLiu24-May-06 1:21
membertroyLiu24-May-06 1:21 
AnswerRe: Get Pin
Alex Hazanov30-May-06 7:18
memberAlex Hazanov30-May-06 7:18 
QuestionRe: Get Pin
troyLiu25-May-06 4:46
membertroyLiu25-May-06 4:46 
GeneralUPDATED! Pin
Alex Hazanov4-Nov-04 23:38
memberAlex Hazanov4-Nov-04 23:38 
GeneralOther Cuestion (VB) Pin
MicroElias Corporation Framework26-Oct-04 6:13
memberMicroElias Corporation Framework26-Oct-04 6:13 
GeneralRe: Other Cuestion (VB) Pin
Alex Hazanov26-Oct-04 10:19
memberAlex Hazanov26-Oct-04 10:19 
GeneralRe: Other Cuestion (VB) Pin
MicroElias Corporation Framework28-Oct-04 11:29
memberMicroElias Corporation Framework28-Oct-04 11:29 
GeneralRe: Other Cuestion (VB) Pin
Alex Hazanov29-Oct-04 13:20
memberAlex Hazanov29-Oct-04 13:20 
GeneralRe: Other Cuestion (VB) Pin
Alex Hazanov29-Oct-04 13:24
memberAlex Hazanov29-Oct-04 13:24 
GeneralRe: Other Cuestion (VB) Pin
MicroElias Corporation Framework8-Nov-04 4:45
memberMicroElias Corporation Framework8-Nov-04 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web03 | 2.8.151126.1 | Last Updated 5 Nov 2004
Article Copyright 2004 by Alex Hazanov
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid