View on GitHub

SARAFF SOFTWARE

All products / Saraff.Twain.NET / Contents

Alternative User Interfaces

The following properties and methods provide an opportunity to implement an alternative user interface:

Below is an example of their use.

this._twain32.ShowUI = false;
public Form1() {
    InitializeComponent();
    try {
        this._twain32.OpenDSM();

        #region Fill DS list

        this.dataSourcesToolStripComboBox.Items.Clear();
        for(int i=0;i<this._twain32.SourcesCount;i++) {
            this.dataSourcesToolStripComboBox.Items.Add(this._twain32.GetSourceProductName(i));
        }
        if(this._twain32.SourcesCount>0) {
            this.dataSourcesToolStripComboBox.SelectedIndex=this._twain32.SourceIndex;
        }

        #endregion

    } catch(Exception ex) {
        MessageBox.Show(ex.Message,"SAMPLE2",MessageBoxButtons.OK,MessageBoxIcon.Error);
    }
}
private void dataSourcesToolStripComboBox_SelectedIndexChanged(object sender,EventArgs e) {
    try {
        this._twain32.CloseDataSource();
        this._twain32.SourceIndex=this.dataSourcesToolStripComboBox.SelectedIndex;
        this._twain32.OpenDataSource();

        // ...

    } catch(Exception ex) {
        MessageBox.Show(ex.Message,ex.GetType().Name,MessageBoxButtons.OK,MessageBoxIcon.Error);
    }
}