BUG: Visible Property of Sheridan Command Button May Not WorkLast reviewed: October 9, 1996Article ID: Q150193 |
The information in this article applies to:
SYMPTOMSThe Sheridan Command button does not stay invisible although the Visible property is set to false. This can occur if the Visible property of a Sheridan Command button was set to false in a procedure in another form.
STATUSMicrosoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article. Microsoft is researching this issue and will post new information here in the Microsoft Knowledge Base as it becomes available.
WORKAROUNDUse the ShowWindow API function instead of the Visible property of the button to hide/show the button. This function takes only two parameters: a window handle that becomes the hWnd property of the Sheridan control, and a constant that determines how to show the window. The declaration below can be pasted in the General...Declarations section of the form where the routine is to hide the window:
#If Win16 Then Private Declare Function ShowWindow Lib "User" (ByVal hWnd As Integer, ByVal nCmdShow As Integer) As Integer #Else Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long #EndIf Const SW_SHOW = 5 Const SW_HIDE = 0To hide a Sheridan Command button, issue a command similar to the following:
ShowWindow Form1.SSCOmmand1.HWnd, SW_HIDEand, to show a button:
ShowWindow Form1.SSCommand1.HWnd, SW_SHOW MORE INFORMATION
Steps to Reproduce Problem
To correct this problem with the workaround, paste the declaration for ShowWindow in the Form...Declarations section of Form2. Instead of the command to make Visible property false, use the following command:
Call ShowWindow(Form1.SSCOmmand1.HWnd, SW_HIDE)The button will not reappear until the following command is issued:
Call ShowWindow(Form1.SSCommand1.HWnd, SW_SHOW) |
Additional reference words: 4.00 vb4win vb4all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |