当前位置:编程学习 > Delphi >>

Delphi中Dmmain是什么意思?

程序代码:

procedure TfrmNewCard.edtUserIdKeyPress(Sender: TObject; var Key: Char);
begin
    //用户按下回车键
    if Key = #13 then
    begin
        if Length(edtUserId.Text) = 0 then //学号为空
        begin
            edtUserId.SetFocus;
        end
        else begin
            with DMMain.tblStudent do
            begin
                Filter := 'user_id=' + ''''
                         + edtUserId.Text + '''';
                Filtered := True;
            end;
            if DMMain.tblStudent.RecordCount <= 0 then
            begin
                ShowMessage('学号为'+edtUserId.Text+ '的学生不存在!');
                edtUserId.SetFocus;
            end
            else edtMoney.SetFocus;
        end;
        Exit;
    end;
    //验证输入的合法性
    if (not (Key in ['0'..'9'])) and (Key <> #8) //退回键
        and (not (Key in ['a'..'z']))
        and (not (Key in ['A'..'Z'])) then
    begin
        Key :=#0;
    end;
end;

请问:DMMain.tblStudent是什么,怎么建立的?

追问:应该是什么数据集?
答案:
看代码好像是数据集连接控件 。

DMMain.tblStudent    DMMain是你的对象名字  和TfrmNewCard.edtUserIdKeyPress  同理

这里是调用了这个对象函数

DMMain肯定是定义过的拉~~类似于form1.tblStudent

至于tblstudent估计是改过名的控件吧 应该不是第三方~~你看下那个Form的控件名称就知道了

上一个:delphi怎么播放flash
下一个:delphi edit文本能实现这个吗?

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,