🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
1 messages
1 total messages Started by ���ܵ�Сʨ Sat, 18 Apr 1998 00:00
ֱ�ӱ༭VB��������������ַ���
#1256
Author: ���ܵ�Сʨ
Date: Sat, 18 Apr 1998 00:00
102 lines
6337 bytes
 ����������VB For Windows�ṩ��һ��ǿ�������Զ��������,��
��������ʽ�ṩ���û�,ʹ�û����Կ���ֱ�۵���ʾ��༭��ݿ�
��ͼƬ�⡢����ȴ�����ݼ��ϡ�
    ������к��е�ÿһ�������Ϊ��Ԫ��,��Ԫ���п��Է�������
��ͼƬ,�û����Զ����е����ݽ��ж�д�������������������Col
��Rowָ���˵�ǰ��Ԫ��������е�λ��,���Ƕ������в�����ǰ��
���������ǿ���ͨ���������ַ�����ָ����ǰ��Ԫ��:
    (1) ���ó��������ָ��;
    (2) �����ڼ��÷������ƶ���ָ��;
    (3) �����ڼ������������Ԫ����ָ����
    ��Text���Կ������û����õ�ǰ��Ԫ������ݡ�
    ���������49������(Property),14���¼�(Event)��7����
��(Method),����ֻ�����˺ͱ����йص�����,�������ݶ��߿ɲ�����
���鼮������˵��һ��,��Ӧ�ó�����ʹ����������֮ǰ,������Fi
le�˵��е�AddFile�����ڹ������м���Grid.VBX�ļ���
    ��������Ĺ��ܷdz�ǿ��,�������ź�����,��δ�ṩ�Ե�Ԫ��
�ı༭���ܡ��û�ֻ��ͨ��Ե�ǰ��Ԫ���Text���Ա������д��Ԫ
������,�������ַ����ǶԾ�̬��ݵĶ�д,���ޱ༭���ܿ��ԡ�
    �����������,������������ֽ������,ȡ���˽Ϻõ�Ӧ��Ч��
,�ֱַ�������¡�
    һ����ӷ�
    ��ӷ���˼·��,����VB�ṩ�Ŀɱ༭���ı���������Ϊ�н�,ͨ
���ı��������Chang e�¼�����,ʵʱ�ؽ��ı�����������ݴ��͸�
�������Ҳ����˵,ͨ���ı�������ı༭�ﵽ��ӱ༭����
�����Ŀ�ġ�������������:
    Private Sub Form__Load()
      Grid1.Row=0
      For i=1 To 4
        Grid1.Col=i
        Grid1.Text=i
      Next i
      Grid1.Col=0
      For i =1 To 3
        Grid1.Row=i
        Grid1.Text=i
      Next i
    End Sub
       Private Sub Grid1__Click()
      Text1.Text=""
      Text1.SetFocus
    End Sub
       Private Sub Text1__Change()
      Colnum=Grid1.SelStartCol
      Rownum=Grid1.SelStartRow
      Grid1.Col=Colnum
      Grid1.Row=Rownum
      Grid1.Text=Text1.Text
    End Sub
ͼ1
    ���ڼ�ӷ��������ı�����б༭,����֧�ֳ�������ֱ༭,��
�һ�֧�ֱ�ǡ�����ȸ��ָ߼��༭,��������к�ǿ�ı༭���ܡ�
����ȱ��Ҳ����Ȼ��:Ϊ�˱༭���,�������һ���ı���,���Ʊػ�
Ӱ����Ļ����;��֮���岻��,����������⡣
    ����ֱ�ӷ�
    ֱ�ӷ���˼·��,�������������KeyDown��KeyPress�¼����
�û��İ������,ͨ��Բ�ͬ����ķ���,��ȡ��Ӧ���ַ��?��
ֱ�Ӵ���Text����(Ҳ����˵�Լ����ƴ����ַ�ij���),�Ӷ�ﵽ
ֱ�ӱ༭��Ԫ���Ŀ�ġ�������������:
        Sub Grid1__KeyDown(KeyCode As Integer,Shift As Integ
er)
      If KeyCode=46 Then grid1.Text=""
      ��Del�����ǰ���Ԫ�������
    End Sub
       Sub Grid1__keyPress(keyasciiAslnteger)
      Select Case keyascii
        Case 8
    �������˸��
    If Len(grid1.Text)=0 Then Exit Sub
    grid1.Text=Left$(grid1.Text,Len(grid1.Text)-1)
    Exit Sub
       Case 46
     ���������
     grid1.Text=grid1.Text+"."
     Exit Sub
       Case 45
        �����?��
    grid1.Text=grid1.Text+"-"
    Exit Sub
       Case 43
    ���������
    grid1.Text=grid1.Text+"+"
    Exit Sub
      End Select
      If(keyascii<48 Or keyascii>58) Then
     �����������
    Beep:Exit Sub
      End lf
      grid1.Text=grid1.Text+Right(Str(keyascii-48),1)
    End Sub
    ��һ�γ���ʵ�ֵĹ�����:�û��������ѡ����ǰ�ĵ�Ԫ��,����
�����ݵ����빤��, ͬʱ�Է��������뷢�����������γ���ֻ֧��
��Del�����ǰ��Ԫ����˸��ɾ��β�ַ�ı༭���ܡ���Ȼ,����
���Ա���Ը����Ҫ������ļ��̲���,�Ӷ���Ƴ���ǿ�ı༭��
�ܡ�
    ֱ�ӷ����ŵ��DZ༭ֱ��,�ҿ�����Ծ���������Ƴ�ר�õı�
������,��ȱ���DZ༭���ܲ�ǿ��
    �ӱ��ߵľ�������,���༭�����ִ���,�򵥵ı༭�����ѿ���
����һ���Ҫ��,���Դӳ����Ż��ĽǶȱ����Ƽ�ʹ��ֱ�ӷ���

--
�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: hsia.nju.edu.cn]
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