DOCUMENT:Q192171 03-SEP-1998 [vbwin] TITLE :BUG: OLEDragDrop Fails on Contained Windowless Controls PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:6.0 OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0 --------------------------------------------------------------------- SYMPTOMS ======== Setting the ControlContainer property of a User Control to True allows a developer or end user to place a control on the User Control at the control's run-time. If you place a Windowless control on the User Control when the User Control is in run-time, the Windowless control's OLEDragDrop will fail. You will be able to drag over the control but the mouse cursor will never change to let you know that you can do a drop. RESOLUTION ========== Use a windowed control. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION ================ Setting the ControlContainer property to True allows you to develop a control that can contain other controls in the same way the PictureBox control can contain other controls. When a windowless control is the contained control on a User Control, the no-drop cursor doesn't change and releasing the mouse over the control has no effect when you are doing an OLEDragDrop. Steps to Reproduce Behavior --------------------------- 1. Create a new Standard EXE project in Visual Basic. Form1 is created by default. 2. From the Project menu, select Components, check "Microsoft Windowless Controls 6.0," then click OK. If you don't have the Windowless controls Installed, please see the REFERENCES section for how to install them. 3. From the Project menu, select Add User Control. 4. Set the ControlContainer property to True and the BackColor of the User Control to some color you can see. 3. Place a TextBox and UserControl1 onto Form1. 4. Place a WLText control on the instance of UserControl1 that is on Form1. 5. Set the following properties for Text1: OLEDragMode = 1-Automatic OLEDropMode = 2-Automatic 6. Set the following properties for WLText1: OLEDragMode = 1-wlOLEDragAutomatic OLEDropMode = 2-wlOLEDropAutomatic 7. Save and run the project. Try highlighting the text in Text1, then dragging it over WLText1. You will see that the mouse drag cursor does not change to a drop cursor. 8. Stop the project and remove the WLText1 from UserControl1. Repeat step 4 but use a standard TextBox. 9. Set the following properties for Text2: OLEDragMode = 1-Automatic OLEDropMode = 2-Automatic 10. Repeat step 7 and you will be able to do a drag and drop to Text2. REFERENCES ========== For additional information, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q189950 TITLE : HOWTO: Install the Microsoft Windowless Controls for VB6 Additional query words: kbDSupport kbDSD kbVBp kbCtrl kbVBp600bug ====================================================================== Version : WINDOWS:6.0 Platform : WINDOWS Issue type : kbbug ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.