Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Speech Door Access System by controling PC

Status
Not open for further replies.
Frankly speaking I don't know VB*.
Well regarding the USB to parallel converter, the OS and driver will take care of the port only you have to check what is the Address it has been assigned to.
Then treat it as a normal Parallel port. No need to be worried about USB.
I guess you got my point??
 

Hi guys, I am currently doing my final year project which is basically using speech recognition system to control the power side mirror and LED signal of a car. I am currently in the midst of using Microsoft SAPI via Visual Basic 6 to perform the speech recognition which so far is pretty much successful as I'm using the sample listbox given by SAPI itself. But the problem I am facing is that since I need to communicate with my microcontroller I would need to enable the serial comm between VB and Microcontroller. The thing is I would like the program to automatically select the list of commands that I have given once I give out the speech. Here's the program that I have written:

Private Sub Form_Load()
Dim strItem(0 To 9) As String 'Making a list of arrays with a variable to display
strItem(0) = "Left Mirror Up"
strItem(1) = "Left Mirror Down"
strItem(2) = "Left Mirror Left"
strItem(3) = "Left Mirror Right"
strItem(4) = "Right Mirror Up"
strItem(5) = "Right Mirror Down"
strItem(6) = "Right Mirror Left"
strItem(7) = "Right Mirror Right"
strItem(8) = "Left Signal"
strItem(9) = "Right Signal"

Dim n As Integer

n = 0 'Having a variable set as zero to ensure that the first count will be included

Do Until n > 9
SpeechListBox.AddItem (strItem(n))

n = n + 1
Loop


' SpeechListBox.AddItem [1]("Left Mirror Up")
' SpeechListBox.AddItem [2]("Left Mirror Down")
' SpeechListBox.AddItem [ ("Left Mirror Left")
' SpeechListBox.AddItem ("Left Mirror Right")
' SpeechListBox.AddItem ("Right Mirror Up")
' SpeechListBox.AddItem ("Right Mirror Down")
' SpeechListBox.AddItem ("Right Mirror Left")
' SpeechListBox.AddItem ("Right Mirror Right")
' SpeechListBox.AddItem ("Left Signal")
' SpeechListBox.AddItem ("Right Signal")


If SpeechListBox.SpeechEnabled Then
chkSpeechEnabled = 1
Else
chkSpeechEnabled = 0
End If

MSComm1.CommPort = 5
MSComm1.Settings = "9600,N,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True

If m_GrammarId = 0 Then
lblText.Caption = "abc"
ElseIf m_GrammarId = 1 Then
lblText.Caption = "def"
ElseIf m_GrammarId = 2 Then
lblText.Caption = "ghi"
ElseIf m_GrammarId = 3 Then
lblText.Caption = "jkl"
ElseIf m_GrammarId = 4 Then
lblText.Caption = "mno"
ElseIf m_GrammarId = 5 Then
lblText.Caption = "zzz"
ElseIf m_GrammarId = 6 Then
lblText.Caption = "asdfsdf"
ElseIf m_GrammarId = 7 Then
lblText.Caption = "dsfsdf"
ElseIf m_GrammarId = 8 Then
lblText.Caption = "dfdf"
ElseIf m_GrammarId = 9 Then
lblText.Caption = "sdfd"
Else
lblText.Caption = "command error"
End If



End Sub


Private Sub chkSpeechEnabled_Click()
SpeechListBox.SpeechEnabled = (chkSpeechEnabled = 1)
End Sub

Private Sub Form_Unload(Cancel As Integer)
If MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
End If
End Sub

Another thing is that whenever I run the program it will automatically have an output of "abc" there even when I speak of other voice commands. Someone please help?

The sample program given by Microsoft SAPI is pretty long and it is:

Option Explicit

' See UserControl_Resize() for how iLevelInResize is used.
' It's needed to make sure our control resizes correctly.
Dim iLevelInResize As Integer

' declare all speech related variables
Const m_GrammarId = 10
Dim bSpeechInitialized As Boolean
Dim WithEvents RecoContext As SpSharedRecoContext
Dim Grammar As ISpeechRecoGrammar
Dim TopRule As ISpeechGrammarRule
Dim ListItemsRule As ISpeechGrammarRule

'Event Declarations:
Event ItemCheck(Item As Integer) 'MappingInfo=InnerList,InnerList,-1,ItemCheck
Event OLEStartDrag(Data As DataObject, AllowedEffects As Long) 'MappingInfo=InnerList,InnerList,-1,OLEStartDrag
Event OLESetData(Data As DataObject, DataFormat As Integer) 'MappingInfo=InnerList,InnerList,-1,OLESetData
Event OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean) 'MappingInfo=InnerList,InnerList,-1,OLEGiveFeedback
Event OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer) 'MappingInfo=InnerList,InnerList,-1,OLEDragOver
Event OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=InnerList,InnerList,-1,OLEDragDrop
Event OLECompleteDrag(Effect As Long) 'MappingInfo=InnerList,InnerList,-1,OLECompleteDrag
Event Scroll() 'MappingInfo=InnerList,InnerList,-1,Scroll
Event Validate(Cancel As Boolean) 'MappingInfo=InnerList,InnerList,-1,Validate
'Default Property Values:
Const m_def_PreCommandString = "Smart"
Const m_def_SpeechEnabled = True
'Property Variables:
Dim m_PreCommandString As String
Dim m_SpeechEnabled As Boolean


Private Sub InitializeSpeech()
' This function will create the main SpSharedRecoContext object and other
' required objects like Grammar and rules. In this sample, we are building
' grammar dynamically since listbox content can change from time to time.
' If your grammar is static, you can write your grammar file and ask SAPI
' to load it during run time. This can reduce the complexity of your code.

On Error GoTo ErrorHandler

If Not bSpeechInitialized Then
Debug.Print "Initializing speech"

Dim AfterCmdState As ISpeechGrammarRuleState
Set RecoContext = New SpSharedRecoContext
Set Grammar = RecoContext.CreateGrammar(m_GrammarId)

' Add two rules. The top level rule will reference the items rule.
Set TopRule = Grammar.Rules.Add("TopLevelRule", SRATopLevel Or SRADynamic, 1)
Set ListItemsRule = Grammar.Rules.Add("ListItemsRule", SRADynamic, 2)

Set AfterCmdState = TopRule.AddState

' The top level rule consists of two parts: "smart <items>". So we first
' add a word transition for the "smart" part, then a rule transition
' for the "<items>" part, which is dynamically built as items are added
' or removed from the listbox.
TopRule.InitialState.AddWordTransition AfterCmdState, _
m_PreCommandString, " ", , "", 0, 0
AfterCmdState.AddRuleTransition Nothing, ListItemsRule, "", 1, 1

' Now add existing list items to the ListItemsRule
RebuildGrammar

' Now we can activate the top level rule. In this sample, only the top
' level rule needs to activated. The ListItemsRule is referenced by
' the top level rule.
Grammar.CmdSetRuleState "TopLevelRule", SGDSActive

bSpeechInitialized = True
End If

Exit Sub

ErrorHandler:
MsgBox "SAPI failed to initialize. This application may not run correctly."
End Sub

Friend Sub EnableSpeech()
Debug.Print "Enabling speech"
If Not bSpeechInitialized Then Call InitializeSpeech

' once all objects are initialized, we need to update grammar
RebuildGrammar
RecoContext.State = SRCS_Enabled
End Sub

Friend Sub DisableSpeech()
Debug.Print "Disabling speech"

' Putting the recognition context to disabled state will stop speech
' recognition. Changing the state to enabled will start recognition again.
If bSpeechInitialized Then RecoContext.State = SRCS_Disabled
End Sub


Private Sub RebuildGrammar()
' In this funtion, we are only rebuilding the ListItemRule, as this is the
' only part that's really changing dynamically in this sample. However,
' you still have to call Grammar.Rules.Commit to commit the grammar.

On Error GoTo ErrorHandler

' First, clear the rule
ListItemsRule.Clear

' Now, add all items to the rule
Dim i As Integer
For i = 0 To InnerList.ListCount - 1
Dim text As String
text = InnerList.List(i)

' Note: if the same word is added more than once to the same rule state,
' SAPI will return error. In this sample, we don't allow identical items
' in the list box so no need for the checking, otherwise special checking
' for identical words would have to be done here.
ListItemsRule.InitialState.AddWordTransition Nothing, text, " ", , text, i, i
Next

Grammar.Rules.Commit
Exit Sub

ErrorHandler:
MsgBox "Error when rebuiling dynamic list box grammar: " & Err.Number
End Sub


Private Sub RecoContext_Hypothesis(ByVal StreamNumber As Long, _
ByVal StreamPosition As Variant, _
ByVal Result As ISpeechRecoResult _
)

' This event is fired when the recognizer thinks there's possible
' recognitions.
Debug.Print "Hypothesis: " & Result.PhraseInfo.GetText & ", " & _
StreamNumber & ", " & StreamPosition
End Sub

Private Sub RecoContext_Recognition(ByVal StreamNumber As Long, _
ByVal StreamPosition As Variant, _
ByVal RecognitionType As SpeechRecognitionType, _
ByVal Result As ISpeechRecoResult _
)

' This event is fired when something in the grammar is recognized.
Debug.Print "Recognition: " & Result.PhraseInfo.GetText & ", " & _
StreamNumber & ", " & StreamPosition

Dim index As Integer
Dim oItem As ISpeechPhraseProperty

' oItem will be the property of the second part in the recognized phase.
' For example, if the top level rule matches "select Seattle". Then the
' ListItemsRule matches "Seattle" part. The following code will get the
' property of the "Seattle" phrase, which is set when the word "Seattle"
' is added to the ListItemsRule in RebuildGrammar.
Set oItem = Result.PhraseInfo.Properties(1).Children(0)
index = oItem.Id

If Result.PhraseInfo.GrammarId = m_GrammarId Then

' Check to see if the item at the same position in the list still has the
' same text.
' This is to prevent the rare case that the user keeps talking while
' the list is being added or removed. By the time this event is fired
' and handled, the list box may have already changed.
If oItem.Name = InnerList.List(index) Then
InnerList.ListIndex = index
End If
End If
End Sub


Private Sub UserControl_Initialize()
iLevelInResize = 0
bSpeechInitialized = False
End Sub

Private Sub UserControl_Resize()

' When the user control is resized, the inner listbox has to be resized
' so that it takes up all the area.
' Since height of inner ListBox changes by the height of a line of text,
' we have to adjust the user control's size, which may cause reentrance to
' this Resize() function. iLevelInResize is used to prevent infinite loop.
iLevelInResize = iLevelInResize + 1

If iLevelInResize = 1 Then
InnerList.Move 0, 0, Width, Height

' The following lines will cause Resize events and thus re-entrance
' to this function. Since iLevelInResize will not be 1 during
' re-entrance, we prevented infinite loop.
Height = InnerList.Height
Width = InnerList.Width
End If

iLevelInResize = iLevelInResize - 1
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,AddItem
Public Sub AddItem(ByVal Item As String, Optional ByVal index As Variant)

' Since we can't add the same word to the same transition in the grammar,
' we don't allow same string to be added multiple times.
' So do nothing if Item is already in the list. Some level of error
' message may be helpful. The sample chooses to silently ignore to keep
' code simple.

' The leading and trailing spaces are not needed, trim it before inserting.
' SAPI will return error in AddWordTransition if two phrases differ only
' in spaces. A program needs to handle this error if random phrase is
' added to a rule.
' Note: In this sample, we only trim leading and trailing spaces. Internal
' spaces will need to be handled as well.

Item = Trim(Item)

If Item = "" Then
Exit Sub
End If

If InnerList.ListCount > 0 Then
Dim i As Integer
For i = 0 To InnerList.ListCount - 1
If StrComp(Item, InnerList.List(i), vbTextCompare) = 0 Then
Exit Sub
End If
Next
End If

' if it doesn't exist yet, add it to the list
InnerList.AddItem Item, index

' if speech is enabled, we need to update the grammar with new changes
If m_SpeechEnabled Then RebuildGrammar
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Appearance
Public Property Get Appearance() As Integer
Appearance = InnerList.Appearance
End Property

Public Property Let Appearance(ByVal New_Appearance As Integer)
InnerList.Appearance() = New_Appearance
PropertyChanged "Appearance"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,BackColor
Public Property Get BackColor() As OLE_COLOR
BackColor = InnerList.BackColor
End Property

Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
InnerList.BackColor() = New_BackColor
PropertyChanged "BackColor"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,CausesValidation
Public Property Get CausesValidation() As Boolean
CausesValidation = InnerList.CausesValidation
End Property

Public Property Let CausesValidation(ByVal New_CausesValidation As Boolean)
InnerList.CausesValidation() = New_CausesValidation
PropertyChanged "CausesValidation"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Clear
Public Sub Clear()
InnerList.Clear
End Sub


'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Columns
Public Property Get Columns() As Integer
Columns = InnerList.Columns
End Property

Public Property Let Columns(ByVal New_Columns As Integer)
InnerList.Columns() = New_Columns
PropertyChanged "Columns"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,DataMember
Public Property Get DataMember() As String
DataMember = InnerList.DataMember
End Property

Public Property Let DataMember(ByVal New_DataMember As String)
InnerList.DataMember() = New_DataMember
PropertyChanged "DataMember"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,DataSource
Public Property Get DataSource() As DataSource
Set DataSource = InnerList.DataSource
End Property

Public Property Set DataSource(ByVal New_DataSource As DataSource)
Set InnerList.DataSource = New_DataSource
PropertyChanged "DataSource"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Enabled
Public Property Get Enabled() As Boolean
Enabled = InnerList.Enabled
End Property

Public Property Let Enabled(ByVal New_Enabled As Boolean)
InnerList.Enabled() = New_Enabled
PropertyChanged "Enabled"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,FontUnderline
Public Property Get FontUnderline() As Boolean
FontUnderline = InnerList.FontUnderline
End Property

Public Property Let FontUnderline(ByVal New_FontUnderline As Boolean)
InnerList.FontUnderline() = New_FontUnderline
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,FontStrikethru
Public Property Get FontStrikethru() As Boolean
FontStrikethru = InnerList.FontStrikethru
End Property

Public Property Let FontStrikethru(ByVal New_FontStrikethru As Boolean)
InnerList.FontStrikethru() = New_FontStrikethru
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,FontSize
Public Property Get FontSize() As Single
FontSize = InnerList.FontSize
End Property

Public Property Let FontSize(ByVal New_FontSize As Single)
InnerList.FontSize() = New_FontSize
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,FontName
Public Property Get FontName() As String
FontName = InnerList.FontName
End Property

Public Property Let FontName(ByVal New_FontName As String)
InnerList.FontName() = New_FontName
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,FontItalic
Public Property Get FontItalic() As Boolean
FontItalic = InnerList.FontItalic
End Property

Public Property Let FontItalic(ByVal New_FontItalic As Boolean)
InnerList.FontItalic() = New_FontItalic
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,FontBold
Public Property Get FontBold() As Boolean
FontBold = InnerList.FontBold
End Property

Public Property Let FontBold(ByVal New_FontBold As Boolean)
InnerList.FontBold() = New_FontBold
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Font
Public Property Get Font() As Font
Set Font = InnerList.Font
End Property

Public Property Set Font(ByVal New_Font As Font)
Set InnerList.Font = New_Font
PropertyChanged "Font"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,ForeColor
Public Property Get ForeColor() As OLE_COLOR
ForeColor = InnerList.ForeColor
End Property

Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
InnerList.ForeColor() = New_ForeColor
PropertyChanged "ForeColor"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,hWnd
Public Property Get hWnd() As Long
hWnd = InnerList.hWnd
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,IntegralHeight
Public Property Get IntegralHeight() As Boolean
IntegralHeight = InnerList.IntegralHeight
End Property

Private Sub InnerList_ItemCheck(Item As Integer)
RaiseEvent ItemCheck(Item)
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,ItemData
Public Property Get ItemData(ByVal index As Integer) As Long
ItemData = InnerList.ItemData(index)
End Property

Public Property Let ItemData(ByVal index As Integer, ByVal New_ItemData As Long)
InnerList.ItemData(index) = New_ItemData
PropertyChanged "ItemData"
End Property


'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,ListIndex
Public Property Get ListIndex() As Integer
ListIndex = InnerList.ListIndex
End Property

Public Property Let ListIndex(ByVal New_ListIndex As Integer)
InnerList.ListIndex() = New_ListIndex
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,ListCount
Public Property Get ListCount() As Integer
ListCount = InnerList.ListCount
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,List
Public Property Get List(ByVal index As Integer) As String
List = InnerList.List(index)
End Property

Public Property Let List(ByVal index As Integer, ByVal New_List As String)
InnerList.List(index) = New_List
PropertyChanged "List"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,MousePointer
Public Property Get MousePointer() As Integer
MousePointer = InnerList.MousePointer
End Property

Public Property Let MousePointer(ByVal New_MousePointer As Integer)
InnerList.MousePointer() = New_MousePointer
PropertyChanged "MousePointer"
End Property


'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,MouseIcon
Public Property Get MouseIcon() As Picture
Set MouseIcon = InnerList.MouseIcon
End Property

Public Property Set MouseIcon(ByVal New_MouseIcon As Picture)
Set InnerList.MouseIcon = New_MouseIcon
PropertyChanged "MouseIcon"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,MultiSelect
Public Property Get MultiSelect() As Integer
MultiSelect = InnerList.MultiSelect
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,NewIndex
Public Property Get NewIndex() As Integer
NewIndex = InnerList.NewIndex
End Property

Private Sub InnerList_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
RaiseEvent OLEStartDrag(Data, AllowedEffects)
End Sub

Private Sub InnerList_OLESetData(Data As DataObject, DataFormat As Integer)
RaiseEvent OLESetData(Data, DataFormat)
End Sub

Private Sub InnerList_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
RaiseEvent OLEGiveFeedback(Effect, DefaultCursors)
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,OLEDropMode
Public Property Get OLEDropMode() As Integer
OLEDropMode = InnerList.OLEDropMode
End Property

Public Property Let OLEDropMode(ByVal New_OLEDropMode As Integer)
InnerList.OLEDropMode() = New_OLEDropMode
PropertyChanged "OLEDropMode"
End Property

Private Sub InnerList_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
RaiseEvent OLEDragOver(Data, Effect, Button, Shift, X, Y, State)
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,OLEDragMode
Public Property Get OLEDragMode() As Integer
OLEDragMode = InnerList.OLEDragMode
End Property

Public Property Let OLEDragMode(ByVal New_OLEDragMode As Integer)
InnerList.OLEDragMode() = New_OLEDragMode
PropertyChanged "OLEDragMode"
End Property

Private Sub InnerList_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent OLEDragDrop(Data, Effect, Button, Shift, X, Y)
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,OLEDrag
Public Sub OLEDrag()
InnerList.OLEDrag
End Sub

Private Sub InnerList_OLECompleteDrag(Effect As Long)
RaiseEvent OLECompleteDrag(Effect)
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,RemoveItem
Public Sub RemoveItem(ByVal index As Integer)
InnerList.RemoveItem index
If m_SpeechEnabled Then RebuildGrammar
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Refresh
Public Sub Refresh()
InnerList.Refresh
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,RightToLeft
Public Property Get RightToLeft() As Boolean
RightToLeft = InnerList.RightToLeft
End Property

Public Property Let RightToLeft(ByVal New_RightToLeft As Boolean)
InnerList.RightToLeft() = New_RightToLeft
PropertyChanged "RightToLeft"
End Property

Private Sub InnerList_Scroll()
RaiseEvent Scroll
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Selected
Public Property Get Selected(ByVal index As Integer) As Boolean
Selected = InnerList.Selected(index)
End Property

Public Property Let Selected(ByVal index As Integer, ByVal New_Selected As Boolean)
InnerList.Selected(index) = New_Selected
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,SelCount
Public Property Get SelCount() As Integer
SelCount = InnerList.SelCount
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Style
Public Property Get Style() As Integer
Style = InnerList.Style
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Sorted
Public Property Get Sorted() As Boolean
Sorted = InnerList.Sorted
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,Text
Public Property Get text() As String
text = InnerList.text
End Property

Public Property Let text(ByVal New_Text As String)
InnerList.text() = New_Text
PropertyChanged "Text"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,ToolTipText
Public Property Get ToolTipText() As String
ToolTipText = InnerList.ToolTipText
End Property

Public Property Let ToolTipText(ByVal New_ToolTipText As String)
InnerList.ToolTipText() = New_ToolTipText
PropertyChanged "ToolTipText"
End Property

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,TopIndex
Public Property Get TopIndex() As Integer
TopIndex = InnerList.TopIndex
End Property

Public Property Let TopIndex(ByVal New_TopIndex As Integer)
InnerList.TopIndex() = New_TopIndex
PropertyChanged "TopIndex"
End Property

Private Sub InnerList_Validate(Cancel As Boolean)
RaiseEvent Validate(Cancel)
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=InnerList,InnerList,-1,WhatsThisHelpID
Public Property Get WhatsThisHelpID() As Long
WhatsThisHelpID = InnerList.WhatsThisHelpID
End Property

Public Property Let WhatsThisHelpID(ByVal New_WhatsThisHelpID As Long)
InnerList.WhatsThisHelpID() = New_WhatsThisHelpID
PropertyChanged "WhatsThisHelpID"
End Property

'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Dim index As Integer
Dim Count As Integer

InnerList.Appearance = PropBag.ReadProperty("Appearance", 1)
InnerList.BackColor = PropBag.ReadProperty("BackColor", &H80000005)
InnerList.CausesValidation = PropBag.ReadProperty("CausesValidation", True)
If PropBag.ReadProperty("Columns", 0) <> 0 Then
InnerList.Columns = PropBag.ReadProperty("Columns", 0)
End If
InnerList.DataMember = PropBag.ReadProperty("DataMember", "")
Set DataSource = PropBag.ReadProperty("DataSource", Nothing)
InnerList.Enabled = PropBag.ReadProperty("Enabled", True)
Set InnerList.Font = PropBag.ReadProperty("Font", Ambient.Font)
InnerList.ForeColor = PropBag.ReadProperty("ForeColor", &H80000008)

Count = PropBag.ReadProperty("ListCount", 0)
For index = 0 To Count - 1
InnerList.ItemData(index) = PropBag.ReadProperty("ItemData" & index, 0)
InnerList.List(index) = PropBag.ReadProperty("List" & index, "")
Next

InnerList.MousePointer = PropBag.ReadProperty("MousePointer", 0)
Set MouseIcon = PropBag.ReadProperty("MouseIcon", Nothing)
InnerList.OLEDropMode = PropBag.ReadProperty("OLEDropMode", 0)
InnerList.OLEDragMode = PropBag.ReadProperty("OLEDragMode", 0)
InnerList.RightToLeft = PropBag.ReadProperty("RightToLeft", False)
InnerList.text = PropBag.ReadProperty("Text", "")
InnerList.ToolTipText = PropBag.ReadProperty("ToolTipText", "")
InnerList.TopIndex = PropBag.ReadProperty("TopIndex", 0)
InnerList.WhatsThisHelpID = PropBag.ReadProperty("WhatsThisHelpID", 0)
m_PreCommandString = PropBag.ReadProperty("PreCommandString", m_def_PreCommandString)
Me.SpeechEnabled = PropBag.ReadProperty("SpeechEnabled", m_def_SpeechEnabled)
End Sub

'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Dim index As Integer

Call PropBag.WriteProperty("Appearance", InnerList.Appearance, 1)
Call PropBag.WriteProperty("BackColor", InnerList.BackColor, &H80000005)
Call PropBag.WriteProperty("CausesValidation", InnerList.CausesValidation, True)
Call PropBag.WriteProperty("Columns", InnerList.Columns, 0)
Call PropBag.WriteProperty("DataMember", InnerList.DataMember, "")
Call PropBag.WriteProperty("DataSource", DataSource, Nothing)
Call PropBag.WriteProperty("Enabled", InnerList.Enabled, True)
Call PropBag.WriteProperty("Font", InnerList.Font, Ambient.Font)
Call PropBag.WriteProperty("ForeColor", InnerList.ForeColor, &H80000008)

Call PropBag.WriteProperty("ListCount", InnerList.ListCount, 0)
For index = 0 To InnerList.ListCount - 1
Call PropBag.WriteProperty("ItemData" & index, InnerList.ItemData(index), 0)
Call PropBag.WriteProperty("List" & index, InnerList.List(index), "")
Next

Call PropBag.WriteProperty("MousePointer", InnerList.MousePointer, 0)
Call PropBag.WriteProperty("MouseIcon", MouseIcon, Nothing)
Call PropBag.WriteProperty("OLEDropMode", InnerList.OLEDropMode, 0)
Call PropBag.WriteProperty("OLEDragMode", InnerList.OLEDragMode, 0)
Call PropBag.WriteProperty("RightToLeft", InnerList.RightToLeft, False)
Call PropBag.WriteProperty("Text", InnerList.text, "")
Call PropBag.WriteProperty("ToolTipText", InnerList.ToolTipText, "")
Call PropBag.WriteProperty("TopIndex", InnerList.TopIndex, 0)
Call PropBag.WriteProperty("WhatsThisHelpID", InnerList.WhatsThisHelpID, 0)
Call PropBag.WriteProperty("SpeechEnabled", m_SpeechEnabled, m_def_SpeechEnabled)
Call PropBag.WriteProperty("PreCommandString", m_PreCommandString, m_def_PreCommandString)
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MemberInfo=0,0,0,True
Public Property Get SpeechEnabled() As Boolean
SpeechEnabled = m_SpeechEnabled
End Property

Public Property Let SpeechEnabled(ByVal New_SpeechEnabled As Boolean)
If m_SpeechEnabled <> New_SpeechEnabled Then
m_SpeechEnabled = New_SpeechEnabled

If Ambient.UserMode Then
If m_SpeechEnabled = True Then
Call EnableSpeech
Else
Call DisableSpeech
End If
End If

PropertyChanged "SpeechEnabled"
End If
End Property

'Initialize Properties for User Control
Private Sub UserControl_InitProperties()
m_PreCommandString = m_def_PreCommandString
Me.SpeechEnabled = m_def_SpeechEnabled
End Sub

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MemberInfo=13,1,0,Select
Public Property Get PreCommandString() As String
PreCommandString = m_PreCommandString
End Property

Public Property Let PreCommandString(ByVal New_PreCommandString As String)

' This property is not available during run time to simplify sample code.
' To support it in run time, you will need to dynamically rebuild the top
' level rule when this property changes.

' If a run time attempt is made to change this property, error is raised.
If Ambient.UserMode Then Err.Raise 382
m_PreCommandString = New_PreCommandString
PropertyChanged "PreCommandString"
End Property


Is there any idea on what or which variables that I should be putting to have the words that I want to pop out at the label box?
 

Attachments

  • sadsad.JPG
    sadsad.JPG
    116.9 KB · Views: 82

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top