Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

C# Listbox control - How to tell if program has selected an item in listbox or the interactive user

$
0
0

Hi,

My form has 2 listbox:

server_type which has items 'dev', 'uat' and 'prod'

ad_domain which has items 'mytestdomain.com', 'myuatdomain.com' and 'mydomain.com'

The scenario is as follows:

On startup the program sets server_type to 'dev' and ad_domain to 'mytestdomain.com',

I want it so that if the user changes server_type to 'prod' then the program changes 

ad_domain to 'mydomain.com' ONLY IF the user has NOT previously changed the ad_domain listbox to something else (eg. myuatdomain.com). If the program just changes the ad_domain listbox unconditionally then the user experience is frustrating as the user's work is being constantly overwritten by the program.

How can my C# program tell if the listbox control has been changed by the program or the user?

Thanks for any help.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>