开发者

ShortdateFormat of application changes if run as Administrator

开发者 https://www.devze.com 2023-02-10 12:06 出处:网络
I have a VB.net application that has datagridviews and date control in windows forms. I have the short date format set in the date controls and short date format is some columns of the datagridview.

I have a VB.net application that has datagridviews and date control in windows forms. I have the short date format set in the date controls and short date format is some columns of the datagridview.

If I run the application on server 2008 it picks up the wrong short date format. I have the server 2008 regional settings as "en-AU" but for some reason the app picks up en-US as the current culture.

If I run the app as the Administrator it seems to pick up the proper culture.

Can anyone give me a reason as to why it could be doing that?

I tried setting the locale manually by doing

    Dim c As Globalization.CultureInfo = New Globalization.CultureInfo(_Culture)
    System.Threading.T开发者_运维问答hread.CurrentThread.CurrentCulture = c
    System.Threading.Thread.CurrentThread.CurrentUICulture = c

But the same results.

Regards, Dasith


What if you specifically set the culture?

Dim c As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("en-US", False)

That goes in the _Load sub of your main form.

0

精彩评论

暂无评论...
验证码 换一张
取 消