Hey guys. I need some help. I'm making a Text to Speech program. I've made a couple versions of them and they all work pretty good. But the new version I'm making has an icon that displays in the tray. I need to know how to call my Rich Text Box in my form, from a different class. Like this:
Public Class SpeakMenuItem
Inherits MenuItem
' Constructor...
Public Sub New()
Text = "Text to Speech"
End Sub
' OnClick...
Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
Dim strText As String
strText = (RichTextBox1.Text)
Dim objVoice = CreateObject("SAPI.SpVoice")
objVoice.Speak(strText)
If RichTextBox1.Text() = "" Then
MsgBox("You need to put text in the textbox before I speak it!", MsgBoxStyle.OkOnly, "Robot")
End If
End Sub
End Class
Can anyone help? Thanks in advance!