Comparing 2 singles, should be same but different

I have a number which is for Fontsize and is a Single and is stored as 30.
If I do a mouse click only on a text field which has that number in it, then the TextChange event reports it is changed.

The if statement is
If ( index = 0 And PfFontMax.Equals (me.Value.ToDouble, 4 ))
and it fails.

The value stored for PfFontMax starts as 30. without any following 0’s and I’m wondering if that is why it fails?

Examine all the values.

dim d as double = me.Value.ToDouble

Using a Single is an odd choice, but since it holds an integer value, even “=” should work. Maybe try defining PfFontMax as Double and see if it makes a difference.

The reason I chose Single is FontSize is single. Previously I had used integer and the size was being reported with 6 0’'s.

I tried double and I still get a text change.

I don’t understand. Reported where? In the debugger?

Sorry. When I changed the size this field would report the size as not just a number but as the FontSize. Since FontSize is Single and I never paid attention to what it really was, I thought it odd I’d have 6 0’s following what I thought was an integer.

I am sorry I didn’t follow through with the debugger. I thought just because the textChange event was firing was good enough. If I had followed past the Return I would have gone to a second control. I have a Vertical ScrollBar which also changes it. The two are linked from the Scroll Bar to the field; however if the field has GotFocus (event), it changes the ScrollBar. I have to re-write the ScrollBar change event so it doesn’t uhmm dirty the window.

The new question is FontSize is single, and any Time I have a conversion it should be okay to use ToDouble, but in one case I can’t.
Am I correct I should be able to.