I've been programming for a few years now and am still plagued with Null reference exceptions cropping up. I've nearly always managed to get round them by playing about with my code but never properly understanding HOW I've fixed it and why it works but didn't earlier...
Can someone please explain in noob words why the following code returns a null reference exception :-
Dim g As Graphics Dim text As String Dim font As New Font("Arial", 6, FontStyle.Bold, GraphicsUnit.Pixel) Dim returnValue As SizeF text = "abcdefg" returnValue = g.MeasureString(text, font)