0
エラーがこの行に起こる......私はWatermark TextBox in WinFormsのコードが見つかりましたが、それはC#バージョンであるので、私はVBのバージョンにコードを変換するためにhttp://converter.telerik.com/を使用しますが、私はまだエラーを取得: -
私はそれを修正するにはどうすればよいのSendMessage(Me.Handle、& H1501、DirectCast(1、のIntPtr)、mCue)
?
エラーメッセージ:BC30311タイプ「整数」の値を「IntPtr」に変換することはできません。
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Class CueTextBox
Inherits TextBox
<Localizable(True)> _
Public Property Cue() As String
Get
Return mCue
End Get
Set
mCue = value
updateCue()
End Set
End Property
Private Sub updateCue()
If Me.IsHandleCreated AndAlso mCue IsNot Nothing Then
SendMessage(Me.Handle, &H1501, DirectCast(1, IntPtr), mCue) 'this line get the error msg
End If
End Sub
Protected Overrides Sub OnHandleCreated(e As EventArgs)
MyBase.OnHandleCreated(e)
updateCue()
End Sub
Private mCue As String
' PInvoke
<DllImport("user32.dll", CharSet := CharSet.Unicode)> _
Private Shared Function SendMessage(hWnd As IntPtr, msg As Integer, wp As IntPtr, lp As String) As IntPtr
End Function
End Class
ありがとう、問題解決済み – vbnewbie