/// <include file='doc\TextBoxBaseDesigner.uex' path='docs/doc[@for="TextBoxBaseDesigner.OnControlPropertyChanged"]/*' />
        /// <devdoc>
        ///      For controls, we sync their property changed event so our component can track their location.
        /// </devdoc>
        private void OnControlPropertyChanged(object sender, EventArgs e)
        {
            ISelectionUIService selectionUISvc = (ISelectionUIService)GetService(typeof(ISelectionUIService));

            if (selectionUISvc != null)
            {
                selectionUISvc.SyncComponent((IComponent)sender);
            }
        }
Пример #2
0
            /// <devdoc>
            ///     Need to know when child windows are created so we can properly set the Z-order
            /// </devdoc>
            protected override void WndProc(ref Message m)
            {
                base.WndProc(ref m);

                if (m.Msg == NativeMethods.WM_PARENTNOTIFY && NativeMethods.Util.LOWORD((int)m.WParam) == (short)NativeMethods.WM_CREATE)
                {
                    if (overlayList != null)
                    {
                        bool ourWindow = false;
                        foreach (Control c in overlayList)
                        {
                            if (c.IsHandleCreated && m.LParam == c.Handle)
                            {
                                ourWindow = true;
                                break;
                            }
                        }

                        if (!ourWindow)
                        {
                            foreach (Control c in overlayList)
                            {
                                SafeNativeMethods.SetWindowPos(c.Handle, (IntPtr)NativeMethods.HWND_TOP, 0, 0, 0, 0,
                                                               NativeMethods.SWP_NOSIZE | NativeMethods.SWP_NOMOVE);
                            }
                        }
                    }
                }
                else if ((m.Msg == NativeMethods.WM_VSCROLL || m.Msg == NativeMethods.WM_HSCROLL) && provider != null)
                {
                    ISelectionUIService selUISvc = (ISelectionUIService)provider.GetService(typeof(ISelectionUIService));
                    if (selUISvc != null)
                    {
                        selUISvc.SyncComponent(null);
                    }
                }
            }