1 / 14

Chapter 15

Chapter 15. Advanced Topics in VB. Advanced Topics in VB. Using ActiveX controls Linking from VB to a Web site Include DLL procedures in your projects Understand Windows API Use OLE container VB and VBA Differentiating between MDI and SDI interfaces. Introduction.

Download Presentation

Chapter 15

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 15 Advanced Topics in VB

  2. Advanced Topics in VB • Using ActiveX controls • Linking from VB to a Web site • Include DLL procedures in your projects • Understand Windows API • Use OLE container • VB and VBA • Differentiating between MDI and SDI interfaces

  3. Introduction • Windows programs have access to other objects through • ActiveX controls • OLE (Object Linking and Embedding) • DLLs (Dynamic Link Libraries) • MDI interface allows multiple forms within an application—such as Excel or Word

  4. ActiveX Controls • Refers to executable files, controls (COM), and DLLs that are used in multiple applications • Microsoft refers to any controls as ActiveX controls. • They can be home brew or part of a package • VB controls are called intrinsic controls • Controls that are added are called components

  5. ActiveX Controls • Tabbed dialog box has several properties that can be set at design or run time • Click the builder button in the tab’s Custom property • Place controls on tabbed dialog boxes by manually drawing them—double-clicking a tool places the control on every tab page

  6. ActiveX Controls (cont'd) • You can also purchase ActiveX controls • ActiveX control files end in .OCX or .VBX • Project, Components lists controls—most are .OCX • The Web Browser control allows you to browse the Web from VB—control is one of the extra components

  7. Creating ActiveX Controls • Select ActiveX control, ActiveX EXE or ActiveX DLL in the New Project dialog box • Create an ActiveX control comprising a calendar control, a text box, and a command button

  8. Dynamic Link Libraries • Libraries store frequently used procedures • Windows uses dynamic link libraries (DLLs) so store collections of executable procedures • Windows DLL procedures are available to VB programs • DLLs that are used to move/resize windows are called APIs (application programming interfaces) • Most DLLs require arguments that you pass to them

  9. Calling a DLL Procedure • Call a procedure within the scope of a declare statement • Arguments to procedure can be constants or variables • Windows provides an API viewer to get help on DLL procedures

  10. Object Linking and Embedding • OLE allows you to link or embed objects from another application into VB project • Linking: access object maintained by another program; shared object stored elsewhere • Embedding: object and ref. to application managing object are stored in your project

  11. Visual Basic for Applications (VBA) • Microsoft office products include VBA for writing procedures to automate office applications (Excel, Word, etc.) • Record Excel macros that accomplish a series of steps • Macros are stored as VBA code • Open code and inspect it

  12. Multiple Document Interface (MDI) • MDI interface is one in which several child forms can be open with a larger, parent form • Word and Excel both are examples of MDI • You can open, close, and resize each child window (form)

  13. Defining Shortcut Menus • Create shortcut menus (right-click accessible menus) with the Menu Editor • Clear the visible checkbox of a shortcut menu so it is invisible until the user calls for it • Code is required to display the shortcut menu

  14. The Report Designer • VB’s Report Designer creates a printed report • Reports based on a database use the Data Environment • Once created, use Show to display it on screen or print it with the PrintReport method • A report design is its template

More Related