击球vfp编程高手的帮忙

来源:百度知道 编辑:UC知道 时间:2024/05/14 09:55:58
public frm
frm = CreateObjet("tform")
frm.visible = .t.

define class tform as form
width=181
height=94
caption="form1"
borderstyle=1

add object command1 as commandbutton with;
left=60,top=60,width=48,;
height=25,caption="打开"

add object command2 as commandbutton with;
left=120,top=60,width=48,;
height=25,caption="播放"

add object text1 as textbox with;
left=12,top=24,width=157,;
height=25

procedure load
do decl1
public str_file as string
str_file=""

procedure command1.click
str_file=getfile("wav")
thisform.text1.value=str_file

procedure command2.click
if str_file="" then
messagebox ("请选择文件")
else
sndplaysound(str_file,0)
endif
enddefine
procedure dec1

别的问题不管,只针对你出现的这两个错误:

你的第二句写错了
原句:frm = CreateObjet("tform")
改成:frm = CreateObject("tform")

少了一个字母【c】,所以就。出现了你说的那两个错误