📄 form1.frm
字号:
VERSION 5.00
Object = "{F5BE8BC2-7DE6-11D0-91FE-00C04FD701A5}#2.0#0"; "AGENTCTL.DLL"
Begin VB.Form Form1
Caption = "Agent控件"
ClientHeight = 2775
ClientLeft = 60
ClientTop = 345
ClientWidth = 3300
LinkTopic = "Form1"
ScaleHeight = 2775
ScaleWidth = 3300
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command6
Caption = "打招呼"
Height = 495
Left = 1920
TabIndex = 5
Top = 720
Width = 1215
End
Begin VB.CommandButton Command5
Caption = "思考"
Height = 495
Left = 600
TabIndex = 4
Top = 720
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "忧愁"
Height = 495
Left = 600
TabIndex = 3
Top = 120
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "移动"
Height = 495
Left = 240
TabIndex = 2
Top = 1680
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "隐藏"
Height = 495
Left = 1560
TabIndex = 1
Top = 1680
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "眨眼"
Height = 495
Left = 1920
TabIndex = 0
Top = 120
Width = 1215
End
Begin AgentObjectsCtl.Agent Agent1
Left = 120
Top = 240
_cx = 847
_cy = 847
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Genie As IAgentCtlCharacterEx
Private Sub Command1_Click()
Genie.Play ("blink")
End Sub
Private Sub Command2_Click()
Genie.Hide '隐藏
End Sub
Private Sub Command3_Click()
i = Genie.MoveTo(300, 400) '(300,400)为移动到的位置的坐标
End Sub
Private Sub Command4_Click()
Genie.Play ("sad")
End Sub
Private Sub Command5_Click()
Genie.Think ("Who are you?")
End Sub
Private Sub Command6_Click()
Genie.Play ("getattention")
End Sub
Private Sub Form_Load()
DATAPATH = App.Path + "\Bill.acs"
Agent1.Characters.Load "Bill", DATAPATH '调入角色
Set Genie = Agent1.Characters("Bill") '创造角色
Genie.LanguageID = &H409
Genie.Show
Genie.Speak "Hello World!" '朗读文字
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -