To have the change buttons disabled when there are no suggestions, unless
the user makes an edit to the query word, implement a custom UI and make
some slight changes.
If you look at our CustomGUIView.cs file in the demo project, you can
easily customize the behaviour of the UI. Eg. change these methods
public object SuggestionsListItems{get{return
this.suggestionsList.DataSource;}
set{
suggestionsList.DataSource=value;
ChangeButtonEnabled = suggestionsList.Items.Count != 0;
//add this
ChangeAllButtonEnabled = suggestionsList.Items.Count != 0;
//add this
}
}
and
private void queryWordPane_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Back && queryWordPane.SelectionStart ==
editableStart)
e.SuppressKeyPress = true;
if (e.KeyCode == Keys.Delete && queryWordPane.TextLength - queryWordPane.SelectionStart == editableEndFromEnd)
e.SuppressKeyPress = true;
if (e.KeyCode == Keys.Enter)
e.SuppressKeyPress = true;
ChangeAllButtonEnabled = true; //add this
ChangeButtonEnabled = true; //add this
}
|