Leadtools TWAIN (Leadtools.Twain assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
IsAvailable Method
See Also 
Leadtools.Twain Namespace > TwainSession Class : IsAvailable Method



owner
Window handle of the application window.
owner
Window handle of the application window.
Determines whether a TWAIN source is installed.

Syntax

Visual Basic (Declaration) 
Public Shared Function IsAvailable( _
   ByVal owner As IWin32Window _
) As Boolean
Visual Basic (Usage)Copy Code
Dim owner As IWin32Window
Dim value As Boolean
 
value = TwainSession.IsAvailable(owner)
C# 
public static bool IsAvailable( 
   IWin32Window owner
)
C++/CLI 
public:
static bool IsAvailable( 
   IWin32Window^ owner
) 

Parameters

owner
Window handle of the application window.

Return Value

true if at least one TWAIN source is installed, false if no TWAIN source is installed.

Example

Visual BasicCopy Code
Public Sub IsAvailableExample(ByVal parent As IWin32Window)
   Dim twainAvailable As Boolean = TwainSession.IsAvailable(parent)
   If twainAvailable Then
      MessageBox.Show("Twain is installed")
   Else
      MessageBox.Show("Twain is not installed")
   End If
End Sub
C#Copy Code
public void IsAvailableExample(IWin32Window parent)
{
   bool twainAvailable = TwainSession.IsAvailable(parent);
   if (twainAvailable)
      MessageBox.Show("Twain is installed");
   else
      MessageBox.Show("Twain is not installed");
}

Remarks

You can use this method to enable or disable the TWAIN menu items for example.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also