String The method receives a string and then Inserts it to the start of the member List, and then forces the ListBox to refresh.
Cast The syntax at the end does a cast and a lookup to get the CurrencyManager and then Refreshes the ListBox.
Tip In the CurrencyManager type, the word Currency refers to current. It is used to ensure a control is current.
Example that uses BindingContext, C#:
private void AddListLine(string lineIn)
// ... Insert the string at the front of the List.
// ... Force a refresh of the ListBox.
A summary. We used the DataSource property on a ListBox control in Windows Forms. CurrencyManager and Refresh() can be used to force a ListBox to display.
Dot Net Perls is a collection of tested code examples. Pages are continually updated to stay current, with code correctness a top priority.
Sam Allen is passionate about computer languages. In the past, his work has been recommended by Apple and Microsoft and he has studied computers at a selective university in the United States.
This page was last updated on Oct 6, 2022 (grammar).