Okay, firstly remove the TextChanged event and all it's code completely, we'll handle it differently
Now remove your definition of "OpenFileDialog1" completely as well, we'll recode the Button2_Click sub to this:
[highlight=vb.net]
Using ofd As New OpenFileDialog With {.CheckFileExists = True, .ShowReadOnly = False, .Filter = "ICO(*.ico)|*.ico|JPG(*.jpg)|*.jpg*|BMP(*.bmp)|*.b mp|TIFF(*.tiff)|*.tiff|GIF(*.gif)|*.gif|PNG(*.png) |*.png"}
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim nextImg As Image = Image.FromFile(ofd.FileName)
HeightLabel.Text = nextImg.Height.ToString
WidthLabel.Text = nextImg.Width.ToString
PictureBox1.Image = nextImg
End If
End Using
[/highlight]
Now when you press okay in the OFD, it will set the pictureboxes image correctly, and display the image's height and width straight away. It's always best to call relevant code in the same event that you start from, rather than from another event which might not sync correctly.