System.Windows.Forms.Clipboard.ContainsText C# (CSharp) Method

ContainsText() public static method

public static ContainsText ( ) : bool
return bool
		public static bool ContainsText ()
		{
			return ClipboardContainsFormat (DataFormats.Text, DataFormats.UnicodeText);
		}
		

Same methods

Clipboard::ContainsText ( TextDataFormat format ) : bool

Usage Example

        /// <exception cref="System.Runtime.InteropServices.ExternalException"></exception>
        /// <exception cref="System.Threading.ThreadStateException"></exception>
        private void KeyboardMouseEvents_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if ((usingControl && e.Control == false) ||
                (!usingControl && e.Control == true))
            {
                return;
            }

            if ((usingShift && e.Shift == false) ||
                (!usingShift && e.Shift == true))
            {
                return;
            }

            if ((usingAlt && e.Alt == false) ||
                (!usingAlt && e.Alt == true))
            {
                return;
            }

            if (((char)e.KeyValue) == cbKeys.SelectedItem.ToString()[0])
            {
                if (Clipboard.ContainsText())
                {
                    string content = Clipboard.GetText();

                    content = selectedMockType.MockifyText(content);

                    Clipboard.SetText(content);
                }
            }
        }
All Usage Examples Of System.Windows.Forms.Clipboard::ContainsText