外文资料翻译VB教程9 Passwords & Splash

上传人:无*** 文档编号:86324275 上传时间:2022-05-07 格式:DOC 页数:25 大小:118.51KB
收藏 版权申诉 举报 下载
外文资料翻译VB教程9 Passwords & Splash_第1页
第1页 / 共25页
外文资料翻译VB教程9 Passwords & Splash_第2页
第2页 / 共25页
外文资料翻译VB教程9 Passwords & Splash_第3页
第3页 / 共25页
资源描述:

《外文资料翻译VB教程9 Passwords & Splash》由会员分享,可在线阅读,更多相关《外文资料翻译VB教程9 Passwords & Splash(25页珍藏版)》请在装配图网上搜索。

1、 淮 海 工 学 院毕业设计(论文)外文资料翻译系 (院): 计算机科学系 专 业: 计算机科学与技术 姓 名: 龚 曦 东 学 号: 3202000135 外文出处: 附 件: 1.外文资料翻译译文;2.外文原文。 指导教师评语: 签名: (亲笔签名) 年 月 日注:请将该封面与附件装订成册。附件1:外文资料翻译译文 VB教程9- Passwords & Splash 在我们上一个教程中我们在数据库练习中学习了如何使用组件和文本框。在这个教程里面,我们回到使用文本框为我们的应用程序设置口令和splash屏幕。在这个练习里面,我们从setup.ini文件中读取加密口令。然后当使用者输入正确的口

2、令时,我们启动一个splash屏幕。使用splash屏幕的两个有利条件是不仅允许你展现你的程序和将其加亮;同样你有时间取初始化一个球形变量的程序。涉及到表格和数据库连接。现在这可能是非常重要的-但是相信我一个有着数个数据库连接和长列表框的VB程序的初始化需要10-25秒钟。splash屏幕比仅仅使用口令会话要好的多。 这里是一个诀窍。在口令程序Form_Load初始化的三分之一的时候,在那时如果口令被认可;做口令程序Form_Load初始化的下一个三分之一。然后做最后的初始化以启动你的最后主窗口。但是,首先让我们看看如何编写口令窗口。Figure 1-口令会话 口令 添加两个文本框到新的工程窗

3、口,称之为“PASSBY”。两个文本框的标签在Figure 1中有显示。第一个文本框不需要什么特别的设置,单口令文本框需要。它的PasswordChar属性需要设置成文“*”。这似的文本框中的每个字符都被星号取代。程序看见的passwd.Text的值旧是是用户输入了的口令。 第二个诀窍是我们有习惯确认无论何时焦点都在口令文本框上面。用以下的代码框中的文本会自动的被选择:REM This code highlights/selects the text when you enterScreen.ActiveControl.SelStart = 0ii = Len(Screen.ActiveCon

4、trol.Text)Screen.ActiveControl.SelLength = ii VB教程七的读者会发现这些代码的一部分十分的熟悉。Screen.ActiveControl引用了普遍的焦点和活跃的控制。这当然是文本框“passwd”。由设置活动的控制的SelStart属性为0且它的SelLength属性等于文本框中文本的长度-这个选择或加亮在立即输入口令中的文本。这意味着用户不必要在输入口令的时候去擦除口令文本框中的内容-这样旧更为方便了。 下一个诀窍是我们认可如果用户输入口令时键入ENTER键表示输入完毕。VB并不会自己认可这一点-你必须使用下列代码来检查,以达到效果:Privat

5、e Sub passwd_KeyPress(KeyAscii As Integer) detect when user presses Enter key and if so validate passwordIf KeyAscii = 13 Then this is the call on the routine that does the password checking Call passwd_Validate(False)End IfEnd Sub 这个子程序每次在当口令文本框中每个字母被键入时被调用。它是在期待一个Ascii码,13。这个值是确认键的Ascii码。当它被按下的时候,

6、控制器立即将输入的文本传送到口令确认程序中去。当然我们也可以在退出口令文本输入框时单击Okay按钮后传送口令确认。 口令确认程序时公平简单的。从设置文件的Form_Load中我们已经得到了一个口令译文。所以现在我们所需要做的是输入的口令是否与口令译文相匹配。如果不匹配,旧发出一个警告信息要求用户重新输入口令。我们可以控制重试的次数,如果超过,就自动完全的推出口令输入程序。 然而,如果口令试有效的我们就调用splash屏幕程序。 passplash是splash屏幕窗口的名字。这里在我们的程序中有最后两个诀窍。首先我们需要对用户隐藏口令输入窗口-因为它调用的窗口我们是不能破坏/毁掉的但必须用代码

7、线PassForm.hide隐藏它。第二个诀窍是任何剩余的初始化都是必须的。使用了折线诀窍后我们对程序的启动代码有了固定的设置。摘要 在这和教程里面我们展示了一些关于使用文本框,获得口令和使用splash屏幕的诀窍。我们又一次的对VB的原有的目标有了好的使用。最终我们利用一些程序和事件与文本框相关联。可视化基本的教程 10 在VB教程的第十章中,我们需要回顾一下前面所学的然后再继续。回顾的重要内容会加上下划线以便我们在做其他的数据库结构部件练习时能够记住。我们重复数据库及其部件的原因是这和新的复数的设计规划非常相似。你作为一个程序设计员,被期待快速的将数据库,VB和第3宴会的组成互联到一个工作

8、包中。事实上,这样做是非常重要的,我们下3-4个教程会揭示如何在WORD 97,2000版本,Visio 5版本以上和其他普遍的WINDOWS可利用的应用软件 中用VBA-Visual Basic做这些。好的或者坏的(好的也有一些明显的缺点)VBA正迅速成为WINDOWS的宏语言。 但首先,让我们复习一下在Figure 1中VB的图象界面接口和一些知道方针的使用和表示方法。要使你对VB变的更为精通熟练,作为原代码编辑者和设计者(特别使数据库设计者)要比视觉窗体编辑者花费更多的时间和精力。在回到你的视觉编辑表格时,你会发现当表格显示时表格属性和工具条并不自动的跳出。Figure 1是工具条的一个

9、提示。Figure 1 你可以单击这个图标以恢复这些重要的参考窗口(这些设置在VIEW菜单中也能被同样使用)。最后,我们将会在 Word, Excel, PhotoPaint, etc中使用VBAS的宏编辑器时看到相同的图标。 Figure 1 也同样帮助我们回答了教程8中关于制作一个non-resizable窗口的问题。请注意在窗口属性上的最大化按钮和最小化按钮工具已经被设置成不可使用。另外的,BorderStyle属性中的窗口大小调整被设置为不被激活的。使用了这些设置,你的窗口将不可调整大小。动态的数据库部件 很多VB工程包括显示数据也作为报告或交叉制表,所以使用者可以能触摸的到他们的数据

10、。数据库格和弯曲格的组成包括 VB 5和6时适当的。然而, 我将鼓励读者从他们的ActiveReports或者DynamiCube部件的下载免费的演示。这些部件时很容易且可兼容的工程。在教程中DynamiCube会被用来展示如何使用简单的图形界面基础来简单的“增压”一个部件。在这种情况下,组合筐会允许我们控制DynamiCube中得到显示的域。 Figure 2展示了连续的DataCube应用程序。 DataCube是用来从CATS数据库(一个ACCESS表格;但是它能简单的实现IBM DB2 or Oracle 8i数据库表格)展示行销数据的。The Unit Price 域将被从Dynam

11、iCube中移除。文件的名字将从In Cube combobox改变成Out of Cube combobox。当the Unit Price 域在comboxes中改变时也会从DynamiCube中被移除。用户赏识这种能力时因为它允许它们单一的或深入到他们所需要的准确的数据方式中去。 设计的诀窍是将combobox装满在DynamiCube中使用的域名字然后就可以知道如何去传输。 Figure 2- 动态的DataCube应用程序Private Sub Form_activate()Dim i As IntegerFor i = 0 To Data1.Database.TableDefs(C

12、ATS).Fields.Count - 1Combo1.AddItem Data1.Database.TableDefs(CATS).Fields(i).NameNextEnd Sub 首先有Form_activate()代码去装载Combo1(在立方体组合框中),使用的域名字时从CATS数据库中来的。如果你计划去做任何数量的VBA和VB设计你必须习惯于VB收集种类被称为协定。同样在VB的收集、特别是TableDef收集帮助主题中都有解释。基本上,通过在CATS表格中使用收集或域的列表来循环。Combo1.AddItem添加各自的名字到Combo1中。另一块大妈转移到DynaCube以外的域中

13、。Private Sub Combo1_Click()If Combo1.ListIndex = 0 ThenCombo2.AddItem Combo1.TextDCube1.Fields.Delete (Combo1.Text)DCube1.RefreshDataCombo1.RemoveItem Combo1.ListIndexEnd IfEnd Sub 首先,在组合框上的单击事件指出的域名已经被电击或选择触发转移。注意事件的顺序。首先,我们把域加到立方体之外的组合框(Combo2)中;然后我们把它从DynaCube (DCube1)中删除,并刷新DynaCube;最后我们把该项目从立方体

14、内的组合框(Combo1)中移除。相反的代码,Private Sub Combo2_Click(),遵循同样的模式。为了少许的编码,一个确定的数据得到充分的显示。 最终方便了简单调整代码提供一交替到 VS/OCX和另外的 smart在我们先前的教程中。当在这种情况下,多数的DynaCube对话框被采纳,那么编写Form_Resize()程序将是简单的。Private Sub Form_Resize()Dim i As IntegerOn Error Resume NextDCube1.Move 0, 400, ScaleWidth, ScaleHeight - 400End Sub 所有我们必

15、须做的就是,将DynaCube恢复到新的表格尺寸时移动到相同的出发点,ScaleWidth和ScaleHeight。注意有些尺寸将引起一个错误,那么调整大小就让旧的设置完整无缺。Visual Basic使用一套设备-测量的独立的单位,a twip,为计算尺寸和位置。屏幕对象的两个道具,wipsPerPixelX和TwipsPerPixelY,在运行的时候能被用来决定显示的准确的尺寸(转换缇到象素或英寸)。vB组件本文档是amzi!logic sever vb组件。 它在logic sever所提供的包装盒上提供了有关用vb来操纵logic sever的说明,内容包含:一个包含了logic se

16、ver引擎的vb组件,自动由c语言字符串转换为vb语言字符串,以及通过常规路径进行自动纠错。本文档由以下几个部分组成:“您好”开场-打开您好初始由vb进入运行概述- 概述关于Logic Server的vb功能使用组件- 如何由vb发送Logic Server指令执行扩展预测- 如何在vb5.0或以后的版本中加入开场扩展预测。参考- 列出有关vb Logic Server的所有功能举例- 一个更加详细的vb例子阐述Logic Server功能您好开场您好的vb程序开场处于sample/vb/hello的目录里,他由一个表格hello.frm(您好的源代码)和一个Logic Server的定义文件

17、amzi.bas组成此表格有一个关于所涉及代码的独立的按纽。代码初始化初始环境并且呼叫hello/2预测值,它用于检查是否有错误的运行条件,若一切正常,则消息框会弹出两个消息,由“您好”变位“祝贺”若要运行,打开vb程序并且选择“运行”。按下“祝贺我” 按纽,然后按“进入”或者在3个ok的消息框上点击鼠标进入。The Logic Server vb组件在顶层的INCLUDE(“包含”)子目录的文件amzi.bas内运作。只要简单的把那个文件加入到你的程序中去,你就能使用了。概述The Amzi! Logic Server VB Module旨在为vb 使用者能轻松的进入由the Logic S

18、erver提供的服务中去。The Logic Server 是个引擎,类似于数据库,当你包含the Logic Server 在你的使用中,你便真正拥有了一个Logic Server引擎。它知道如何在初始逻辑库中处理已编译的动态初始预测。 Logic Server API提供如下功能能使您:开始和结束引擎,同样装载和运行初始化代码,动态插入和撤退逻辑terms,指出逻辑性问题,纠正检查所有答案,使用直觉化的符串界面以便于交流,使用详细的term控制功能以便于交流,处理错误。The Logic Server 组件最初分配在amzi.bas文件里,您可以在顶端创建你自己的vb功能,或者修改他们的界

19、面功能。(如果你决定改进界面,请联系我们以便我们在今后的组件发行中包含他们)当你比较vb组件的时候,您会发现他们功能增多了,某种程度上,他们被改进了。 API的功能已被描述,主要区别有:与以“ls”开始相反,功能名字以LS结束(is用于直接的 DLL 呼叫).功能不以引擎ID作为对象,而是在VB组件和带有SetCurrentEngineLS处理。所有的功能以BASIC串为对象而不是C串,由Prolog返回至Basic串符的最长值由被称为SetMaxStrLenLS控制。功能并不返回错误码,错误由VB组件通过纠错惯例处理,此功能的执行由所谓SetErrorHandlerLS控制。根据这些设置,此

20、惯例可以:1发出 31300错误信号或2显示错误框,并且有选择的关闭Logic Server,然后结束程序。 成功或失败,功能将返回VB值:“正确”或者“错误”;许多功能现在在执行因为他们没有必要返回错误码;这里有无数标有他们名字的新功能,从而增加了更多的常规动态打印和指出API的呼叫。列如:lsGetArg把对象当作目标类型并指向那种类型。VB组件拥有如GetStrArgLS的功能,他可以简单返回那些串值。哲理话的说,VB组件尽可能的保留了许多纯正的API特性,并且增加了使其提供一个更象VB的界面。使用组件若要申请包含Logic Server,只需简单添加the Logic Server V

21、B组件amzi.bas文件到您的程序;若要呼唤the Logic Server ,只需简单的将API指令嵌入你所使用的功能中,同时你需要打开和关闭the Logic Server,下列代码可打开the Logic Server:Dim s as String, term as longCall InitLS()Call LoadLS (hello)tf = CallStrLS(term, hello(vb, X)Call GetArgLS(term, 2, bSTR, s)Call CloseLS登陆一个被编译的初始文件,执行一个简单的问题,并且关闭Logic Server。此代码被设为开始程

22、序hello.pro,在hello(vb, prolog)表格中已存在,他同样假设hello.pro已经被编译而连接去创建一个 hello.xpl。而此文件目前正处于目录或者你的路径之中,查询Amzi! Prolog + Logic Server manual以获取更多关于编译和连接开始代码的信息。执行增加的预测VB5.0 (及以后的版本),如C/C+, Java 和 Delphi能被用来执行被制定的扩展的预测到初始化的语言中。这些被定制的扩展使初始代码拥有能直接到达任何VB可到达的文件的能力。执行增加预测的VB功能必须在他们自己的组件中使用。列如:Public Function PMsgBo

23、x(ByVal EngineID As Long) As Long所增加的预测把返回“1”认为成功(正确)而“0”认为失败 (错误),通过使用VB组合功能AddPredLS,预测值每次增加一个。注明:所增加预测值的定义必须在呼叫InitLS之后和呼叫LoadLS之前处于目录samplesvbextpred下的样例包含一个简单的例子:添加消息框预测值至初始参考。参考:此部分包含amzi.bas单位的界面部分,他能定义the Logic Server VB Module,您可以浏览源代码获得更多细节:Logic Server 常量建立Logic Server 的功能为扩展预测所设的功能呼叫初始功能

24、逻辑库动态语句功能串term转换功能取得/获得初始类型的功能操纵结构功能操纵列表功能混合功能Logic Server常量这些是由Logic Server使用的简单常量,他们被用来指定API数据类型的值。 For unicode systems, set unicode to True#Const unicode = False Last Error Message and CodeGlobal ErrorLS As StringGlobal ErrLS As Integer The current engine idDim EngineID As Long The type of error

25、handling to perform, 0=message boxes, 1=generate errorsDim ErrorMethod As Variant The maximum size of strings returned from PrologDim MaxStrLen As Variant Prolog TypesGlobal Const pATOM = 0Global Const pINT = 1Global Const pSTR = 2Global Const pFLOAT = 3Global Const pSTRUCT = 4Global Const pLIST = 5

26、Global Const pTERM = 6Global Const pADDR = 7Global Const pVAR = 8Global Const pWSTR = 9Global Const pWATOM = 10 Basic TypesGlobal Const bATOM = 0Global Const bSTR = 1Global Const bINT = 2Global Const bLONG = 3Global Const bSHORT = 4Global Const bFLOAT = 5Global Const bDOUBLE = 6Global Const bADDR =

27、7Global Const bTERM = 8Global Const bWSTR = 9Global Const bWATOM = 10建立Logic Server此功能提供基本的API服务,他们被用来初始化和关闭初始环境The function, Main, runs the main/0 predicate of a load Prolog file.Sub InitLS (ByVal INIFile As String)Sub InitLSX ()Sub AddLSX (ByVal LSXFile As String)Sub AddPredLS(ByVal Predname As St

28、ring, ByVal Arity As Integer, ByVal pfunc As Long)Sub LoadLS (ByVal XPLFile As String)Function MainLS () as IntegerSub ResetLS ()Sub CloseLS ()They are based on the API functions lsInit, lsInitLSX, lsAddLSX, lsLoad, lsMain, lsReset, and lsClose.下列功能控制VB组件下的参量,SetMaxStrLenLS为所有从初试到Basic返回的串值设定最大串值。Se

29、tErrorHandlerLS 选择是否错误信息显示于消息框或通过错误#31300 显示,当错误显示后,ErrorLS 被设置为Amzi! Logic Server错误码。显示此操作的路线被称为ErrorHandle. Sub SetMaxStrLenLS (ByVal num As Integer)Sub SetErrorHandlerLS (ByVal ErrMethod As String)Extended PredicatesWhen you write an extended predicate, you can directly manipulate the Prolog para

30、meters to that function. These predicates provide that service. The Get family retrieves the nth parameter that was used in the call, and the Unify family unifies some computed result with the nth parameter.当你写一增加预测,您可以直接操纵初始参数到那个功能,这些预测提供初始化服务。The get family检索在呼唤中所使用的nth参数, 而the unify family统一由nth参

31、数计算出的值。VB组件包含一系列特定型的补充到basicAPI,譬如:GetLongParmLS 和 UnifyStrParmLS功能。Sub GetParmLS(ByVal Param As Integer, ByVal BType As Integer, Ptr As Variant)Function GetStrParmLS(ByVal Param As Integer) As StringFunction GetIntParmLS(ByVal Param As Integer) As IntegerFunction GetLongParmLS(ByVal Param As Intege

32、r) As LongFunction GetFloatParmLS(ByVal Param As Integer) As SingleFunction GetParmTypeLS(ByVal Term As Long, ByVal ParmNum As Integer) As IntegerFunction StrParmLenLS(ByVal ParmNum As Integer) As IntegerFunction UnifyParmLS(ByVal Param As Integer, ByVal BType As Integer, ByVal Ptr As Variant) As Bo

33、oleanFunction UnifyStrParmLS(ByVal Param As Integer, ByVal Str As String) As BooleanFunction UnifyAtomParmLS(ByVal Param As Integer, ByVal Str As String) As BooleanFunction UnifyIntParmLS(ByVal Param As Integer, ByVal IntVal As Integer) As BooleanFunction UnifyLongParmLS(ByVal Param As Integer, ByVa

34、l LongVal As Long) As BooleanFunction UnifyFloatParmLS(ByVal Param As Integer, ByVal FloatVal As Single) As BooleanThese functions are based on the API functions lsGetParm, lsGetParmType, lsUnifyParm, and lsStrParmLen.这些功能事实上称作为初始逻辑库/程序预测,他们所提问的term能被表示为一个串或一个初始term,永远统一于呼叫的结果。重做功能开始返回,他能使term同下一个结果

35、再次统一。ClearCall is only useful if you start a Redo loop and dont finish. It clears the stack.Function ExecLS (TermPtr As Long) as BooleanFunction ExecStrLS (TermPtr As Long, ByVal StrPtr) as BooleanFunction CallLS (TermPtr As Long) as BooleanFunction CallStrLS (TermPtr As Long, ByVal StrPtr As String

36、) as BooleanFunction RedoLS () as BooleanSub ClearCallLS ()Function GetCurrentEngineLS () as LongSub SetCurrentEngineLS (NewEngID as Long)这些功能建立于 API功能lsExec, lsExecStr, lsCall, lsCallStr, lsRedo, 和 lsClearCall.之上。取得和SetCurrentEngineLS使您the Logic Server多项请求中启动,要使用他们,呼叫InitLS然后使用 GetCurrentEngineLS取得

37、ID,保存那个值,再次呼叫InitLS 并使用GetCurrentEngineLS取得新ID,也保存那个值,然后启动,使用SetCurrentEngineLS call 在主动初始引擎中。逻辑库的动态语句这些功能使插入和撤回来自或返回初始逻辑库中的动态term更加容易。Sub AssertaLS (ByVal Term As Long)Sub AssertzLS (ByVal Term As Long)Function RetractLS (ByVal Term As Long) as BooleanSub AssertaStrLS (ByVal StrPtr As String)Sub As

38、sertzStrLS (ByVal StrPtr As String)Function RetractStrLS (ByVal StrPtr As String) as BooleanThese functions are based on the API functions lsAsserta, lsAssertaStr, lsAssertz, lsAssertzStr, and lsRetract.附件2:外文原文(复印件)VB Tutorial 9 - Passwords & Splash In our last tutorials we learned to use component

39、s and textboxes as part of a database exercise. In this tutorial we return to the use of textboxes setting up a password and a splash screen for our application. In this exercise we read an encrypted password from an setup.ini file. Then when the user enters the correct password, we start up a splas

40、h screen. Two advantages of using a splash screen is that it not only allows you to advertise your program and highlight its wares; but also you have time to initialize a programs global variables, reference tables and database connections. This may not seem important now - but trust me a VB program

41、 with several database connections and long listboxes to initialize can take 10-25 seconds to load - a splash screen is much better than just staring at the password dialog. Here is the trick. Do 1/3 of the initializing on the Form_Load of the password procedure. Then if the password is okay; do the

42、 next 1/3 of the initializing on the Form_Load of the splash screen. Then do the final initialization on start-up of your final main form. But first, lets see how to code a password screen. Figure 1 - Password Dialog Passing WordsAdd two textboxes to a new project form, call it passby. The labels fo

43、r the two textboxes are as shown in Figure 1. The first textbox does not require any special setting but the password textbox does. Its PasswordChar property is set to the character *. This causes the textbox to be filled with asterisks for each character typed. But the value of passwd.Text seen by

44、the program is the password typed in by the user. The second trick we have used is to make sure whenever the password textbox gains focus, the text in the box is automatically selected with the following code:REM This code highlights/selects the text when you enterScreen.ActiveControl.SelStart = 0ii

45、 = Len(Screen.ActiveControl.Text)Screen.ActiveControl.SelLength = iiNow readers of VB Tutorial seven will find portions of this code very familiar. Screen.ActiveControl refers to the control which currently has focus or is active. This of course is the textbox passwd. By setting the active controls

46、SelStart property to 0 and its SelLength property equal to the length of the text in the box - this selects or highlights the text in the password immediately on entry. This means the user does not have to be sure to erase the contents before entering the password - just a convenience. The next tric

47、k we have is to recognize if the user types the Enter key when he is done entering the password. VB does not recognize entry of the Enter key - you have to check for it with the following code:Private Sub passwd_KeyPress(KeyAscii As Integer) detect when user presses Enter key and if so validate pass

48、wordIf KeyAscii = 13 Then this is the call on the routine that does the password checking Call passwd_Validate(False)End IfEnd SubThis subroutine is called every time a letter is typed in the password textbox. It is look for one KeyAscii code, 13, which is the value of the Enter key. When that is pr

49、essed then control is immediately passed to the password validation procedure. Of course we also call the password validation after the Okay button is clicked or when the password textbox is exited.The password validation procedure is fairly simple. On Form_Load we have already gotten the decrypted

50、password from the setups file. So now all we need to do is check if the entered password matches the decrypted password. If it does not we issue a warning message asking the user to re-enter the password. We could keep a count of the tries and then exit from the password procedure altogether.However

51、, if the password is valid then we call the splash screen routine as follows: We are in call the splash screenpassplash.Showwhere passplash is the name of the Splash screen form. Its here where the last 2 tricks are performed in our program. First, we need to hide the password form from the user - b

52、ecause its is the calling window we cannot just destroy/kill it but have to hide it with the code line PassForm.hide. The second trick is to do any leftover initialization required. And with these tricks we have a solid set of program start up code. SummaryIn this tutorial we have shown some tricks

53、associated with using text boxes and getting passwords and the use of splash screens. We have again used VBs predefined objects to good use. Finally we take advantage of some of the many procedures and events associated with textboxes Visual Basic Tutorial 10 In this our tenth VB tutorial, we shall

54、take a look back and then go forward. The look back will underline the most important points to remember about the VB interface while doing another database component exercise. The reason we are repeating database and components is because this is what programming in the new millennia is really like

55、. You, as programmer will be expected to quickly interconnect databases, VB and 3rd party components into a working package. In fact, this is so important, our next 3-4 tutorials will uncover how to do this with VBA-Visual Basic Applications available in every copy of Word 97 (or later), Word Perfec

56、t 2000 (and on), Visio 5 (or later) and dozens of other popular Windows programs. For better or for worse (with the good there are some distinct shortcomings) VBA is rapidly becoming the macro language for Windows.But first, let us review the VB GUI interface and some guidelines for usage as shown i

57、n Figure 1. As you become more proficient in VB you will spend more time in the Source Code editor and the many designers (especially the database designer)than in visual forms editor. So often you close down the ToolBox or the Properties Sheet to make space and really motor in the Source Code Edito

58、r or whatever. On returning to visual-edit your form, you discover that the Property Sheet or Toolbox do not automatically pop up when the form is displayed. Figure 1 is a reminder of the toolbar Figure 1 icons that you can click on to restore these important reference windows(these settings are als

59、o available in the View menu). Finally, we shall see identically the same icons when using VBAs macro editor in Word, Excel, PhotoPaint, etc.Also Figure 1 helps to answer the question from tutorial 8 - how do you make a form non-resizable. Notice that on the Property Sheet the forms MinButton and Ma

60、xButton properties have been set to False. In addition, the BorderStyle property is set such that sizable is not enabled. With these settings your form cannot be resized.Dynamic Database ComponentsA lot of VB projects involve displaying data either as reports or cross-tabulations - so users can get

61、a feel for their data. The database grid and flex grid components included with VB 5 and 6 are adequate. However, I would encourage readers to download free demos from of their ActiveReports and/or DynamiCube components. These components are very flexible and easy to program. DynamiCube will be used

62、 in the tutorial to show how easy it is to supercharge a component with some simple GUI elements. In this case two combo boxes which will allow us to control what fields get displayed in the DynamiCube. Figure 2 shows the running DataCube application. DataCube is displaying marketing data from the CATS database (an Access table ; but it just as easily could be IBM DB2 or Oracle 8i database tables). The Unit Price field is about to be removed from the DynamiCube - the field name will be tr

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!