How should I cast in VB.NET?

Those are all slightly different, and generally have an acceptable usage. var.ToString() is going to give you the string representation of an object, regardless of what type it is. Use this if var is not a string already. CStr(var) is the VB string cast operator. I’m not a VB guy, so I would suggest avoiding it, but it’s not … Read more

Cannot access a disposed object – How to fix?

Try checking the IsDisposed property before accessing the control. You can also check it on the FormClosing event, assuming you’re using the FormClosed event. We do stop the Timer on the FormClosing event and we do check the IsDisposed property on the schedule component before using it in the Timer Tick event but it doesn’t help. Calling GC.Collect before … Read more

Cannot access a disposed object – How to fix?

Try checking the IsDisposed property before accessing the control. You can also check it on the FormClosing event, assuming you’re using the FormClosed event. We do stop the Timer on the FormClosing event and we do check the IsDisposed property on the schedule component before using it in the Timer Tick event but it doesn’t help. Calling GC.Collect before … Read more