System.Windows.Forms.DataObject.GetFormats C# (CSharp) Method

GetFormats() public method

public GetFormats ( ) : string[]
return string[]
        public virtual string[] GetFormats()
        {
            return null;
        }

Same methods

DataObject::GetFormats ( bool autoConvert ) : string[]

Usage Example

Example #1
0
        protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (this.AllowDrag)
            {
                if (e.X < this.Width && e.Y < this.Height && e.X > 0 && e.Y > 0)
                {
                }
                else
                {
                    if (e.Button == System.Windows.Forms.MouseButtons.Left)
                    {
                        System.Windows.Forms.DataObject    data = new System.Windows.Forms.DataObject();
                        System.Windows.Forms.DragEventArgs de   =
                            new System.Windows.Forms.DragEventArgs(data,
                                                                   1,/*left mouse down*/
                                                                   e.X, e.Y,
                                                                   System.Windows.Forms.DragDropEffects.All,
                                                                   System.Windows.Forms.DragDropEffects.All);

                        OnDragStarting(this, de);
                        DoDragDrop(de.Data.GetData(data.GetFormats(false)[0]), System.Windows.Forms.DragDropEffects.All);
                        OnDragFinished(this, de);
                        //we there because need workaround of missing MouseUp after completing DoDragDrop
                        m_Pressed = false;
                        RefreshLayout();
                    }
                }
            }
        }
All Usage Examples Of System.Windows.Forms.DataObject::GetFormats