PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Easy way to check if the Clipboard is empty or not...-VBForums
Results 1 to 2 of 2

Thread: Easy way to check if the Clipboard is empty or not...

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2016
    Location
    Tennessee
    Posts
    2,259

    Easy way to check if the Clipboard is empty or not...

    I came across some code that works well and doesn't take up lines and lines of code just to check all the different formats to see if the clipboard is empty or not.

    Code:
       Public Declare Function CountClipboardFormats Lib "user32" () As Long
    
       Public Shared Function IsClipboardEmpty() As Boolean
            IsClipboardEmpty = (CountClipboardFormats() = 0)
        End Function
    Just add the declaration and the small function and it works great!
    Hope someone can use this...

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    102,196

    Re: Easy way to check if the Clipboard is empty or not...

    For the record, assigning to the function name is a VB6 holdover. In VB.NET, it is preferable to use a Return statement:
    vb.net Code:
    1. Return CountClipboardFormats() = 0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width