Hello everybody,
can anybody tell me if it is possible (and if how) to use windows default spellchecking feature?
Below there is a complete codesippit how to accomplish this with a standard control. In this sample a textBox will be added on Form1.vb. I want to do exactly the same with a radTextBox. Type some missspelled text an you will see the spellCheck feature.
Thanks for answering.
Mat
###
'Reference:
' PresentationCore.dll
' PresentationFramework.dll
' WindowsFormsIntegration.dll
' WindowsBase.dll
Imports System.Windows.Forms.Integration
Public Class Form1
Private WithEvents txt As New MySpellCheck
Public Sub New()
InitializeComponent()
Me.Controls.Add(txt.ElementHost)
End Sub
End Class
Public Class MySpellCheck
Inherits System.Windows.Controls.TextBox
Public Sub New()
Dim eh As ElementHost = New ElementHost
System.Windows.Controls.SpellCheck.SetIsEnabled(Me, True)
With eh
.Child = Me
End With
Me.ElementHost = eh
End Sub
Private _elementhost As ElementHost
Public Property ElementHost() As ElementHost
Get
Return Me._elementhost
End Get
Set(ByVal value As ElementHost)
Me._elementhost = value
End Set
End Property
End Class
can anybody tell me if it is possible (and if how) to use windows default spellchecking feature?
Below there is a complete codesippit how to accomplish this with a standard control. In this sample a textBox will be added on Form1.vb. I want to do exactly the same with a radTextBox. Type some missspelled text an you will see the spellCheck feature.
Thanks for answering.
Mat
###
'Reference:
' PresentationCore.dll
' PresentationFramework.dll
' WindowsFormsIntegration.dll
' WindowsBase.dll
Imports System.Windows.Forms.Integration
Public Class Form1
Private WithEvents txt As New MySpellCheck
Public Sub New()
InitializeComponent()
Me.Controls.Add(txt.ElementHost)
End Sub
End Class
Public Class MySpellCheck
Inherits System.Windows.Controls.TextBox
Public Sub New()
Dim eh As ElementHost = New ElementHost
System.Windows.Controls.SpellCheck.SetIsEnabled(Me, True)
With eh
.Child = Me
End With
Me.ElementHost = eh
End Sub
Private _elementhost As ElementHost
Public Property ElementHost() As ElementHost
Get
Return Me._elementhost
End Get
Set(ByVal value As ElementHost)
Me._elementhost = value
End Set
End Property
End Class