简体   繁体   English

VBNET中的(IntPtr)1的等价物?

[英]Equivalent of (IntPtr)1 in VBNET?

I've taken a piece of code from a @Hans Passant code from here: Bold text in MessageBox 我从这里的@Hans Passant代码中获取了一段代码: MessageBox中的粗体文本

this is the C# code: 这是C#代码:

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

Which would be the translation into vb.net? 哪个会翻译成vb.net?

This will not work (cant be compiled): 这不起作用(无法编译):

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

尝试这个:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM