Leadtools TWAIN (Leadtools.Twain assembly)
LEAD Technologies, Inc

SelectSource Method

Example 





String contains source name to be selected
Displays the TWAIN dialog box to be used to select a TWAIN source for acquiring images.
Syntax
public DialogResult SelectSource( 
   string sourceName
)
'Declaration
 
Public Function SelectSource( _
   ByVal sourceName As String _
) As DialogResult
'Usage
 
Dim instance As TwainSession
Dim sourceName As String
Dim value As DialogResult
 
value = instance.SelectSource(sourceName)
public DialogResult SelectSource( 
   string sourceName
)
 function Leadtools.Twain.TwainSession.SelectSource( 
   sourceName 
)
public:
DialogResult SelectSource( 
   String^ sourceName
) 

Parameters

sourceName
String contains source name to be selected

Return Value

One of the DialogResult values.
If an error occurs, an exception is thrown.
Remarks
For more information, refer to Managing the TWAIN Source.
Example
 
Public Sub SelectSourceExample(ByVal parent As IWin32Window)
   Dim session As TwainSession = New TwainSession()
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)

   If session.SelectSource(String.Empty) <> DialogResult.OK Then
      MessageBox.Show("Error Selecting Source")
   End If

   session.Shutdown()
End Sub
public void SelectSourceExample(IWin32Window parent)
{
   TwainSession session = new TwainSession();
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);

   if (session.SelectSource(string.Empty) != DialogResult.OK)
      MessageBox.Show("Error Selecting Source");

   session.Shutdown();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

TwainSession Class
TwainSession Members
Startup Method
Shutdown Method
IsAvailable Method
Acquire Method

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.