I'm using a RichTextBox control to simulate a basic editor. Everything if functioning very well.
But after I insert any image, how can I change the cursor caret whenever the user try to resize that image? I mean, how detect the hover event of the mouse (and change its caret) when it is over an image?
Thank you all!
EDIT1:
Follows the code I'm using to allow users to put images within RTB:
Private Sub ContextMenuStrip1Items_Click(sender As Object, e As ToolStripItemClickedEventArgs)
Select Case e.ClickedItem.Text
Case "Colar", "Paste"
Try
ContextMenuStrip1.Close()
Dim Formato As DataFormats.Format = Nothing
If **Clipboard.ContainsImage** Then
Formato = DataFormats.GetFormat(DataFormats.Bitmap)
If RichTextBox1.CanPaste(Formato) Then
RichTextBox1.Paste(Formato)
End If**
ElseIf Clipboard.ContainsText(TextDataFormat.Html) Then
Formato = DataFormats.GetFormat(DataFormats.Html)
If RichTextBox1.CanPaste(Formato) Then
RichTextBox1.Paste(Formato)
Else
RichTextBox1.Paste
End If
ElseIf Clipboard.ContainsText(TextDataFormat.Rtf) Then
Formato = DataFormats.GetFormat(DataFormats.Rtf)
If RichTextBox1.CanPaste(Formato) Then
RichTextBox1.Paste(Formato)
Else
RichTextBox1.Paste
End If
elseif clipboard.ContainsText
RichTextBox1.Paste
Else
MsgBox("Formato não suportado")
End If
Catch ex As Exception
End Try
Case "Imagem", "Image"
Using OFD As New OpenFileDialog
With OFD
.Multiselect = False
.InitialDirectory = "C:\Documents"
.Filter = "Image files (*.Bmp, *.Gif, *.Jpg, *.Png, *.Tif)|*.Bmp;*.Gif;*.Jpg;*.Png;*.Tif"
End With
ContextMenuStrip1.Close()
If OFD.ShowDialog = Windows.Forms.DialogResult.OK Then
If OFD.FileName <> "" Then
Clipboard.SetImage(Image.FromFile(OFD.FileName))
RichTextBox1.Paste()
End If
End If
End Using
End Case
End Sub