Leadtools.Twain Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
IsAvailable Method
See Also  Example
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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also