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

SetText() public method

public SetText ( string textData ) : void
textData string
return void
        public virtual void SetText(string textData)
        {
        }

Usage Example

Example #1
0
        private void SETextBox_MouseDown(object sender, MouseEventArgs e)
        {
            if (MouseButtons == MouseButtons.Left && !string.IsNullOrEmpty(_dragText))
            {
                Point pt = new Point(e.X, e.Y);
                int index = GetCharIndexFromPosition(pt);
                if (index >= _dragStartFrom && index <= _dragStartFrom + _dragText.Length)
                {
                    // re-make selection
                    SelectionStart = _dragStartFrom;
                    SelectionLength = _dragText.Length;

                    DataObject dataObject = new DataObject();
                    dataObject.SetText(_dragText, TextDataFormat.UnicodeText);
                    dataObject.SetText(_dragText, TextDataFormat.Text);

                    _dragFromThis = true;
                    if (Control.ModifierKeys == Keys.Control)
                    {
                        _dragRemoveOld = false;
                        DoDragDrop(dataObject, DragDropEffects.Copy);
                    }
                    else if (Control.ModifierKeys == Keys.None)
                    {
                        _dragRemoveOld = true;
                        DoDragDrop(dataObject, DragDropEffects.Move);
                    }
                }
            }
        }
All Usage Examples Of System.Windows.Forms.DataObject::SetText