ComponentFactory.Krypton.Toolkit.ViewManager.ComponentFromPoint C# (CSharp) Method

ComponentFromPoint() public method

Is the provided point associated with a component.
public ComponentFromPoint ( Point pt ) : Component
pt Point Mouse point.
return System.ComponentModel.Component
        public virtual Component ComponentFromPoint(Point pt)
        {
            // Find the view element associated with the point
            ViewBase target = Root.ViewFromPoint(pt);

            // Climb parent chain looking for the first element that has a component
            while (target != null)
            {
                if (target.Component != null)
                    return target.Component;

                target = target.Parent;
            }

            return null;
        }

Usage Example

Beispiel #1
0
        public Component DesignerComponentFromPoint(Point pt)
        {
            // Ignore call as view builder is already destructed
            if (IsDisposed)
                return null;

            // Ask the current view for a decision
            return ViewManager.ComponentFromPoint(pt);
        }
All Usage Examples Of ComponentFactory.Krypton.Toolkit.ViewManager::ComponentFromPoint