I have a situation where a Sub turns things on or off depending on a boolean passed into it. I would like to pass the boolean and use it to set visible (and readonly) properties of controls.
Lets assume valueBoolean = True. Some I want turned on (*.visible = valueBoolean). But there are some in the same Sub that I want turned off (*.visible = THEOPPOSITEOFvalueBoolean). I wanted to use <> (*.visible <> valueBoolean), but that isn't allowed.
I created a simple function called switchBoolean that does this. It finds the value of valueBoolean and returns the opposite (*.visible = switchBoolean(valueBoolean)). This works fine, but is there another way to do this that doesn't need a function call?
I agree, but Microsoft's support is mediocre at best, and it is commonly non-existent. I worked for a big company and we had troubles with Red Hat (which I am not a fan of) and "some" servers. Red Hat sent us a temporary patch, and it solved the problem. We also had trouble with Windows Server (I think it was Windows Server 2003 or 2008). Microsoft gave us a lot of trouble sending us private hotfixes. Microsoft does the impossible to escalate issues. Our final solution: reinstall the whole Directory. It wasn't a pleasant experience.
Question
t_r_nelson
I am fairly new to VB.Net so please bear with me.
I have a situation where a Sub turns things on or off depending on a boolean passed into it. I would like to pass the boolean and use it to set visible (and readonly) properties of controls.
Lets assume valueBoolean = True. Some I want turned on (*.visible = valueBoolean). But there are some in the same Sub that I want turned off (*.visible = THEOPPOSITEOFvalueBoolean). I wanted to use <> (*.visible <> valueBoolean), but that isn't allowed.
I created a simple function called switchBoolean that does this. It finds the value of valueBoolean and returns the opposite (*.visible = switchBoolean(valueBoolean)). This works fine, but is there another way to do this that doesn't need a function call?
Thanks for the help.
Link to comment
https://www.neowin.net/forum/topic/543740-set-boolean-to-opposite-in-vb/Share on other sites
5 answers to this question
Recommended Posts