Returns the text an item shows in the edit field.
Class: SftBox
Namespace: Softelvdm.SftBoxNET
Assembly: Softelvdm.SftBoxNET
public string DisplayText( ItemClass item );Public Function DisplayText( ByVal item As ItemClass ) As String
item
The item, or null/Nothing.
The text of the item's display column, its SftBox.DisplayMember value when the list is bound to a data source, or an empty string for null/Nothing.
Returns the text an item shows in the edit field.
private void buttonClear_Click(object sender, EventArgs e) {
listView1.Items.Clear();
strLastEvent = "";
fLastEventDup = false;
}
// The text of the selected item, as the combo box shows it
private string Selection(SftBox box) {
return box.SelectedItem == null ? "none" : box.DisplayText(box.SelectedItem);
}
// sftBox1 - an edit field with a dropdown; typing completes the name of a fruit
private void sftBox1_SelectedItemChanged(object sender, EventArgs e) {
DumpValues("sftBox1.SelectedItemChanged (" + Selection(sftBox1) + ")", e);
}
fLastEventDup = False
End Sub
' The text of the selected item, as the combo box shows it
Private Function Selection(ByVal box As SftBox) As String
If box.SelectedItem Is Nothing Then
Return "none"
End If
Return box.DisplayText(box.SelectedItem)
End Function
' SftBox1 - an edit field with a dropdown; typing completes the name of a fruit
Private Sub SftBox1_SelectedItemChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SftBox1.SelectedItemChanged
DumpValues("SftBox1.SelectedItemChanged (" + Selection(SftBox1) + ")", e)
End SubSee Also SftBox Class | Classes | SftBox/NET 3.0