Equivalent to (IntPtr) 1 in VBNET?

I took a snippet of code from @Hans Passant code from here: Bold text in MessageBox

this is C # code:

SendMessage(hText, WM_SETFONT, mFont.ToHfont(), (IntPtr)1)

What will be the translation on vb.net?

This will not work (impossible to compile):

SendMessage(hText, WM_SETFONT, mFont.ToHfont(), DirectCast(1, IntPtr))
+4
source share
1 answer

Try the following:

SendMessage(hText, WM_SETFONT, mFont.ToHfont(), New IntPtr(1))
+5
source

All Articles