开发者

Settings variable returning a different value in VB.net!

This is a quite strange problem. I have set a setting variable in Appli开发者_JAVA技巧cation settings with following data:

  • Name: county
  • Type: integer
  • Scope: user
  • Value: 0

Yet when I reference it with this statement: MsgBox(My.MySettings.Default.county) It alerts 1. Despite being the first to be executed as soon as form loads.


I'm assuming that the My.MySettings bit is a typo.

Often when someone sees a different value than they expect when reading from My.Settings, it seems to be that they are reading the Default rather than the actual value.
I'd suggest trying to use just MsgBox(My.MySettings.county) and see if that returns what you want.

Otherwise, try to delete the bin and object directories of the project and try to re-compile and re-run and see if it might be something that had gotten "stuck" somewhere.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜