<p>Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default!</p>

<p><strong>/EDIT:</strong> Without having source to the object itself</p>

[{'answer_id': 41612, 'author': 'Eugene Yokota', 'author_id': 3827, 'author_profile': 'https://Stackoverflow.com/users/3827', 'pm_score': 1, 'selected': False, 'text': '<p>I don\'t use VB, but here it goes.</p>\n\n<p>I found <a href="http://msdn.microsoft.com/en-us/library/aa733705%28VS.60%29.aspx" rel="nofollow noreferrer">Using the Value of a Control</a>, but it\'s not a programmatic solution.\nIf you have access to the code, look for</p>\n\n<pre><code>Attribute Value.VB_UserMemId = 0\n</code></pre>\n\n<p>using Notepad.</p>\n'}, {'answer_id': 41623, 'author': 'DAC', 'author_id': 1111, 'author_profile': 'https://Stackoverflow.com/users/1111', 'pm_score': 0, 'selected': False, 'text': "<blockquote>\n  <p>you have access to the code, look for</p>\n</blockquote>\n\n<p>Unfortunetly I don't have access to the code for most of the controls. However the link is useful for the Microsoft Controls, but I still would like a way to know for other controls.</p>\n"}, {'answer_id': 54239, 'author': 'John T', 'author_id': 5553, 'author_profile': 'https://Stackoverflow.com/users/5553', 'pm_score': 1, 'selected': False, 'text': '<p>It depends on when you want to determine this.  You could print the "value" of, say, a label control (which has no "value" property) to the debugger like:</p>\n\n<pre><code>debug.print "Value for cmdTest is ["+format(cmdTest)+"]"\n</code></pre>\n\n<p>Which will give you something like:</p>\n\n<blockquote>\n  <p>Value for cmdTest is [False]</p>\n</blockquote>\n\n<p>As it turns out, the default value for a command button is it\'s state (pressed or not), so if you put the code example above in the click event for the control, you will see "True", if you execute it somewhere else, you\'ll see "False".</p>\n\n<p>For other results, this method will at least show you the sort of property you\'re looking for.  You could use:</p>\n\n<pre><code>debug.print "cmdTest\'s value is of type ["+TypeName(oObject) +"]"\n</code></pre>\n\n<p>which tell you the actual type, namely:</p>\n\n<blockquote>\n  <p>cmdTest\'s value is of type [Boolean]</p>\n</blockquote>\n\n<p>You could use various methods to narrow things down, such as setting the value and seeing what happens.</p>\n'}, {'answer_id': 2478693, 'author': 'DAC', 'author_id': 1111, 'author_profile': 'https://Stackoverflow.com/users/1111', 'pm_score': 2, 'selected': True, 'text': '<p>Use OLE/Com Object Viewer, which is distributed with Microsoft Visual Studio. </p>\n\n<p>Go to type libraries and find the library the control is housed in, for example CommandButton is stored in <strong><em>Microsoft Forms 2.0 Object Library</em></strong>. Right click the library and select view. Find the coclass representing the control and select it:</p>\n\n<p><img src="https://i.imgur.com/BervR.png" alt="alt text"></p>\n\n<p>As can be seen, the default interface for CommandButton is ICommandButton, when you inspect ICommandButton look for a property that has a dispid of 0. The IDL for the dispid 0 property of CommandButton is:</p>\n\n<pre><code>[id(00000000), propput, bindable, displaybind, hidden, helpcontext(0x001e8d04)]\nvoid Value([in] VARIANT_BOOL rhs);\n[id(00000000), propget, bindable, displaybind, hidden, helpcontext(0x001e8d04)]\nVARIANT_BOOL Value();\n</code></pre>\n\n<p>Showing you the default property.</p>\n'}]
['https://Stackoverflow.com/questions/41492', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1111/']