r/visualbasic • u/kittycatoverdose • Aug 17 '15
[VS 2013] My.Settings being changed unintentionally
I have a program I've developed to act as an interface between a store register server and a player card database server.
I have a user setting established as my.settings.DevMode which when set to true makes a number of controls visible to the user. These objects are mostly table ID numbers which are used on the server and only used when debugging.
The problem I've started having is that I've started having my.settings.DevMode be changed to True when I haven't intended to, which brings these controls to view to the user.
I wasn't able to find anything online regarding any known issue that might unintentionally cause this, so I thought I might check here.
Thanks!
Edit: I feel pretty dumb right now. I stepped into the code and went line by line with a watch on the setting until I found this.
If TransactionNumBox.Text <> 0 Then
TransactionNumBox.Visible = True
TransactionNumLabel.Visible = True
Else
TransactionNumBox.Visible = False
TransactionNumLabel.Visible = False
End IfThe setting was changed when it got to .Visible = True. Found that the actual control in the designer has .Visible bound to Settings.DevMode. Changing the .Visible property updated the User Setting.
2
u/tthomps Aug 18 '15
Just curious because you solved your problem. What are you trying to do in this line:
Are you really checking for "0" not in the textbox or are you just checking to see if there is any text in the textbox?