Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by ���ܵ�Сʨ
Sat, 18 Apr 1998 00:00
������VB��ƶ�ý��Ч����û�����
Author: ���ܵ�Сʨ
Date: Sat, 18 Apr 1998 00:00
Date: Sat, 18 Apr 1998 00:00
109 lines
6212 bytes
6212 bytes
Visual Basic��Ϊһ����������Windows��ý��Ӧ�ó���Ŀ���
���,���书��ǿ��ͼ����õ������ܵ��������Ա��ϲ������
����Ӧ�������˵,�û�����ĺ��뻵,�����������һ��ֱ�۵�ӡ��
��Ҳ��FoxPro For Windows��ʾ�����е��ƶ�ͼ�ΰ�ť����������
�˺����ӡ��,���������û����������������ĺ�̨����,���ǽ�
���??���Ľ���������������VB��ʵ��������û����档
��������֪��,Ҫ��ʵ�ֺ�̨����,��ؼ������ľ���������ʹ
ͼ�ΰ�ť���ƶ���ͬʱ����ȥִ�����ֳ���Windows��һ��������
�IJ���ϵͳ,����ִ�������ͬʱҲ�ɼ���¼�����Ӧ��,����������
ִ������,��ֻ����Ϣ�洢����,�����Ϣ��Ϊ�����¼������ʹ
�����¼����ϵõ���Ӧ,���������Ľ��㡣VB�ṩ��Do-Events��һ
���ͽ�����������,������ʹCPU����Windows����,ȥ��Ӧ����
�¼���������ͼ�ΰ�ť���ƶ�������ѭ�����,�������Ǿ���ѭ����
����DoEvents�������,�����ʹ����ִ��ѭ��һ��֮��,��CPU����
���ظ�Windows��Windows����Ƿ��й����¼�,�����,��ȥ��Ӧ��ͬ
�����,���������ֵij���ѭ����Ҳ�����Ǵ��?Ȼ��,�������õ���
��ͼ������������ͬʱ������¼�������,�Ϳ�ʵ���ƶ��İ�ť
�ͱ�������̨ͬ�ݳ���
���,VB����ֻ��"BEEP"ָ����Է���"����"��,Ҫ����������ֻ
�õ���Windows�Ķ�̬���ӿ�DLL�еĺ�����ǵ���VB��̬���ӿ��ļ�
VBX������ֻ�����ڴ�����ͨ��˵�����ֶԵ���Windows��"SOUND.D
RV"���еļ���API�������˵��,Ȼ����þͿ����ˡ��⼸��������
Ҫ�Ĺ�����ʹ�����������ö�ĸ���,����ʹ�÷����ɲ����йص�
�ο��鼮,������Ͳ�һһ�����ˡ������������:
`ͨ��˵������
Declear Function OPENSOUND Lib "SOUND"()As Integer
Declear Function STARTSOUND Lib "SOUND"()As Integer
Declear Function CLOSESOUND Lib "SOUND"()As Integer
Declear Function SetVoiceSound Lib "SOUND"(ByVal nVoice
As Integer,ByVallF requency as long,ByVal nDuration As Inte
ger)As Inte-ger
Declear Function SetVoiceQueueSize Lib "SOUND"(ByVal nV
oice As Integer,ByV al nBytes As Integer)As Integer
Dim F(25) As Single ����������
'ͨ�ú���
Sub SOUND (ByVal FREQUENCY&,ByVal DURATION%)
FREQUENCY&=FREQUENCY& * 65535
X=SetVoiceSound(1,FREQUENCY&,DURATION%)
Y=STARTSOUND() '��������װ��
YY=DoEvents() 'ִ�й����¼�
End Sub
Sub Form_Load '������
x=opensound() '����װ��
y=SetVoiceQueueSize(1,1024) '���ø��������
Const C5=523:D5=587:E5=659:F5=698:G5=784:A5=880:B5=988:C
6=1047
' ���巢��Ƶ�� 523��C�ķ���Ƶ��,587��D�ķ���Ƶ��,����
����
Const du2=5.46*20 '���巢�����ʱ��
F(1)=F(17)=C5:F(2)=F(16)=D5:F(3)=F(15)=E5:F(4)=F(14)=F5
F(5)=F(13)=G5:F(6)=F(12)=A5:F(7)=F(11)=B5:F(8)=F(9)=F(10
)=C6
FOR J = 1 TO 17
SOUND F(J),DU2
NEXT J
End Sub
'���屻����,�ƶ�ͼ��ť
Sub Form_Activate()
For I = 100 to 900 Step 15
CMD3D1.Move 5 * I,1250
YY = DoEvents() 'ִ�й����¼�
NEXT I
For I = 100 TO 700 Step 8
CMD3D1.Move 4500,750+5*I
YY = DoEvents()
NEXT I
End Sub
'�û�ж�ش���
Sub Form_Unload(Cancel As Integer)
CLOSESOUND '�رշ���װ��
End Sub
Sub Command3D1_Click()
CLOSESOUND
End
End Sub
'���崰��
Begin Form Music
BACKCOLOR = &h00c0c0&
CAPTION = "WELCOME TO VISUAL BASIC WORLD"
CLIENTHEIGHT = 5430
CLIENTLEFT = 1515
CLIENTTOP = 1515
CLIENTWIDTH = 7260
HEIGHT = 5835
LEFT = 1455
LINKTOPIC = "FORM1"
SCALEWIDTH = 7260
TOP = 1170
WIDTH = 7380
'���ť
BEGIN SSCommand CMD3D1
CAPTION = "CMD3D"
CLIENTHEIGHT = 5430
FONT3D = 2 'RAISED W/HEAVY SHADING
HEIGHT = 1000
LEFT = 500
PICTURE = (BITMAP)
ROUNDEDCORNERS = 0 ' FALSE
TOP = 1250
WIDTH = 1000
END
END
���ϳ����ڼ�������Windows 3.2��Visual Basic 3.0רҵ����
ִ��ͨ��ó���ֻ��˵����������VBʵ��
--
[m[1;37m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: hsia.nju.edu.cn][m
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads