Windows Time Zone Dropdown in C# [closed]

自古美人都是妖i 提交于 2021-01-27 23:12:07

问题


Is there a simple way to display Windows Time zone drop down in an application in C# so the user can change it?

Similar to this Timezone drop down


回答1:


I would do this as per the Microsoft Docs.

ReadOnlyCollection<TimeZoneInfo> tzCollection;
tzCollection = TimeZoneInfo.GetSystemTimeZones();

Then you could set a combobox DataSource equal to that collection like so

comboBox.DataSource = tzCollection;


来源:https://stackoverflow.com/questions/63743833/windows-time-zone-dropdown-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!