Microsoft KB Archive/173212

= FIX: "Default" Property Ignored for CommandButton on Win NT =

Article ID: 173212

Article Last Modified on 12/10/2003

-

APPLIES TO

 Microsoft Visual Basic 5.0 Control Creation Edition, when used with:  Microsoft Windows 2000 Standard Edition

 Microsoft Windows 98 Standard Edition

 Microsoft Windows NT 4.0  Microsoft Visual Basic 5.0 Learning Edition, when used with:  Microsoft Windows 2000 Standard Edition</li></ul>

 Microsoft Windows 98 Standard Edition</li></ul>

 Microsoft Windows NT 4.0</li></ul> </li> Microsoft Visual Basic 5.0 Professional Edition, when used with:  Microsoft Windows 2000 Standard Edition</li></ul>

 Microsoft Windows 98 Standard Edition</li></ul>

 Microsoft Windows NT 4.0</li></ul> </li> Microsoft Visual Basic 5.0 Enterprise Edition, when used with:  Microsoft Windows 2000 Standard Edition</li></ul>

<ul> <li>Microsoft Windows 98 Standard Edition</li></ul>

<ul> <li>Microsoft Windows NT 4.0</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q173212

<div class="symptoms_section">

SYMPTOMS
When you use either the Slider control or the ListView control provided by the COMCTL32.OCX (version 5.00.3717, 5.00.3828, or 6.00.8022), the "Default" property of a command button is ignored. No error occurs, but the button's Click event is not executed.

This behavior only occurs under the Windows NT, Windows 98, Windows Me, and Windows 2000 operation systems. This does not occur under Windows 95.

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Basic 6.0.

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol> <li>Create a new Standard EXE project. Form1 is created by default.</li> <li>Add a reference to the "Windows Common Controls" (COMCTL32.OCX).</li> <li>Add a CommandButton on to the default form.</li> <li>Set the Default property of the CommandButton to True.</li> <li> Paste the following code in the code window of the form: Private Sub Command1_Click MsgBox "Click Event Has Been Fired" End Sub </li> <li>Place a TextBox, ListView, and a Slider control on the form.</li> <li>Save and run the application.</li> <li>Set the focus on the TextBox and press the ENTER key.

RESULT: The CommandButton's Click event fires and the message box appears as expected.</li> <li>Set the focus on either the Slider or the ListView controls.</li> <li>Press Enter.

RESULT: The CommandButton's Click event does not fire and the message box does not appear.</li></ol>

Keywords: kbbug kbcontrol kbfix kbvbp600fix KB173212

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.