1. Trang chủ
  2. » Thể loại khác

John wiley sons advanced visual basic 6 techniques

520 175 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 520
Dung lượng 5,16 MB

Nội dung

To access the contents, click the chapter and section titles Advanced Visual Basic Techniques Go! Keyword Brief Full Advanced Search Search Tips (Publisher: John Wiley & Sons, Inc.) Author(s): Rod Stephens ISBN: 0471188816 Publication Date: 06/01/97 Search this book: Go! Introduction - Part One—Application Basics Chapter 1—ExpenseReporter from a User’s Point of View Using ExpenseReporter Field Validations Managing Controls Print Preview and Printing Managing Files Help Key Techniques Creating Scrolling Areas Arranging Controls Creating Controls Dynamically Enhancing Field Navigation Selecting a Document Interface Managing SDI Documents Setting DataModified IgnoreModify Using DataModified Loading and Saving Files SaveDataAs SaveData Open Files Specified in the Command Line New Designing Menus Mnemonics and Accelerators Menus That Present Dialogs Separators Standard Menus Providing Recent File Lists File List Menu Items UpdateRecentFileMenu SaveRecentFiles LoadRecentFiles AddRecentFile RemoveRecentFile Summary Chapter 2—Building the ExpenseReporter Key Techniques Providing Feedback Validating Data Validating Forms Output-Only Text Boxes Formatting Text Printing The Printer Object Print Previewing Managing Two Scroll Bars Printing with a Dialog Providing Printer Setup Providing Help Types of Help Systems Building a Help File Using a Help File in Visual Basic Providing Context-Sensitive Help Windows 3.x Style Help Windows 95 Style Help Displaying About Dialogs and Splash Screens Summary Chapter 3—AppointmentBook Using AppointmentBook Selecting Dates Viewing Appointments Creating Appointments Modifying or Deleting Appointments Loading and Saving Data Purging Old Data Displaying Help Displaying Context-Sensitive Help Viewing the About Dialog Keeping Pieces Synchronized Key Techniques Using Bit Masks Defining Bit Masks Combining Bit Masks Bit Masks in AppointmentBook Using the MVC Paradigm Models Views Controllers View/Controllers MVC in AppointmentBook Creating Fonts Using CreateFont Scrolling Large Amounts of Data Setting Alarms Creating Nonrectangular Forms Presenting Help Building a Help Browser Building Help Documents Summary Part Two—Add-Ins Chapter 4—PropertySetter Installing PropertySetter Using PropertySetter Key Techniques Understanding OLE Creating Add-Ins Setting Project Options Creating the Add-In Class Creating Sub Main Creating the Server DLL Summarizing Add-In Creation Testing Add-Ins Summary Chapter 5—Aligner Using Aligner Key Techniques Providing AfterClick Aligning Controls in Columns Aligning Controls in Rows and Columns Summary Chapter 6—Scroller Using Scroller Key Techniques Creating Add-In Submenus Creating the Scrolling Area Creating Controls Setting Control Containment Arranging Scrolling Area Controls Summary Chapter 7—AddInMaker Using AddInMaker Key Techniques Managing AddInMaker’s Dialog Building Sub Main Building ConnectAddIn and DisconnectAddIn CreateConnectAddIn CreateDisconnectAddIn Creating Command Classes Summary Part Three—Databasics Chapter 8—PeopleWatcher Using PeopleWatcher Key Techniques Understanding Databases Database Engines The Data Manager Using the Data Control The Data Control Binding Other Controls Selecting Records Coding for the Data Control Using Data Access Objects Creating Recordsets Understanding PeopleWatcher Managing the Outline Control Displaying Appropriate Commands Editing Records Editing Images Accepting and Canceling Changes Validating Data Customizing the Interface for Users The DBUser Class Field Validation Testing Database Applications Summary Chapter 9—Query Using Query Key Techniques Creating Databases Composing SQL Commands CREATE DROP ALTER SELECT INSERT UPDATE DELETE Processing SQL Statements ProcessAllCommands StripCommands ProcessCommand ProcessSelect Privileges Summary Chapter 10—PeopleWatcher Remote Key Techniques Accessing Remote Databases Directly Using Remote Databases with Data Controls Attaching Remote Tables Attaching Programmatically Using Data Managers Improving Network Performance Summary Part Four—Client/Server Applications Chapter 11—TimeSync Using TimeSync Key Techniques Step 1: Testing within the Client TimeSync Step Step 2: Testing Locally Building the Server Building the Client Testing Step Summary Step 3: Testing Remotely Compile the Server Install the Server Register the Server Grant Server Access Start the Automation Manager Register the Server Run the Client Trouble Shooting Using RegClass Summary Chapter 12—QueryServer Using QueryServer Key Techniques Building ReportList QueryServerForm ReportListForm ParameterForm ReportForm Building Librarian Building SQLServer A Typical SQLServer Free-Format SQL Summary Chapter 13—AsyncServer Using AsyncServer Key Techniques Building Asynchronous Servers in Visual Basic Requesting Reports Getting Report Parameters Imitating Modality Requesting Reports Generating Reports Scheduling the Report Starting the Report Object Building the Report Displaying Results Displaying the ReportForm Displaying the Report Displaying Messages Summary Part Five—ActiveX Chapter 14—The Alarm Control Using the Alarm Control Key Techniques Working with Control Projects The Test Application The ActiveX Control Running the Test Application Managing Control Display Implementing Property Procedures Setting Default Property Values Using Ambient Properties Deferring Execution during Initialization Reading and Writing Property Values Delegating Standard Properties Property IDs The Enabled Property Raising Events Summary Chapter 15—Bar Gauge Interacting with Bar Gauge Programming Bar Gauge Key Techniques Managing Bar Gauge Properties Min, Max, KeyChangeAmount, and Value BackColor and ForeColor Style Appearance Drawing Bar Gauge Managing the Mouse MouseDown ComputeValue MouseMove MouseUp Handling Keyboard Events Modifying Bar Gauge TicGauge WidGauge PicGauge Dial A Combined Gauge Summary Chapter 16—Histogram Using Histogram Programming Histogram Key Techniques Managing Control Arrays Scrolling Data Delegating to a Control Array Supporting Indexed Properties Raising Indexed Events Summary Part Six—ActiveX on the Web Chapter 17—ActiveX Controls on the Web Using ActiveX Controls on Web Pages Key Techniques Ensuring Safe Use Certificate Authorities Displaying ActiveX Controls The OBJECT Statement Learning Class IDs An Example Page Updating Labels Selecting Colors Loading Data Asynchronously Loading Asynchronous Data Loading Pictures on the Web Summary Chapter 18—WebSurvey Using WebSurvey Key Techniques Building the Web page Radio Buttons Tables Select Controls Text Areas Text Boxes Check Boxes Sending Data across the Web InetXfer Receiving Data across the Web Packing and Unpacking Data AppendSegment RemoveSegment Summary Chapter 19—SiteMapper Using SiteMapper Key Techniques Retrieving Web Documents Parsing URLs Understanding URLs ParseURL Expanding URLs Mapping Web Sites Menus.FRM, 38 Message box, 212 Message dialog, 312 Messages, displaying, 312–313 Microsoft Access, 204 Microsoft Internet Explorer, 369 Microsoft Internet Transfer Control, 387, 405, 408 Microsoft Jet database engine, 204 Microsoft Paint, 18 Microsoft FoxPro, 203 Microsoft Visual Basic, 309 Microsoft Word, 18, 19, 79–81 Min, 114, 243, 351 Min value, 334, 343, 353 MinButton, 87, 88 Mirror-image printing, 76 Mnemonics, 36–37, 40, 49 mnuFileList, 48 mnuNavigate, 127 Modality, imitating, 306–307 Models, 107–110 summary, 110 Model/view/controller (MVC) See AppointmentBook paradigm, usage, 1, 101, 107–115 Mouse, management, 333, 342–345 MouseDown, 342–343 MouseMove, 344 MouseUp, 344–345 MultiLine property, 64 Multiple document interface (MDI), 18–20 application, 21, 39, 44 form, 44, 45, 289, 295, 306, 308, 312 MVC See Model/view/controller N NAME parameter, 390 Navigation features, providing, 127–129 Netscape Navigator, 377 Network operation, 410 Network performance, improving, 257, 264 New, 35–36, 38, 235 Nonblank captions, 128 Nonrectangular forms, creation, 101, 121–124 Nonscrolling regions, 81 Nonzero integer values, 104 NotifyViews subroutine, 106, 109, 113 NumBars, 361, 362 property, 358, 360 NumPoints property, 373 NumValues, 361, 362 property, 359 O Object Browser, 157, 337 OBJECT command, 371, 374 Object Linking and Embedding (OLE) automation error, 280 automation support files, 276 clients, 143 DLL, 154, 155, 187 options, 277 server class, 299 servers, 142–145, 155, 271–273, 296 service provider, 276 understanding, 142–143 OBJECT statement, 374–375, 383 Object window, 320 OLE See Object Linking and Embedding Open, 33–34, 38, 235 OpenURL, 410, 414, 417, 418 method, 407 Option buttons, 111 OPTION commands, 393 OPTION statement, 394 Options, 43–44 menu, 44 OPTIONS section, 82 ORDER BY clause, 207, 242, 246 Orientation, 116 Outer join, 244 Outline control, management, 214–218 Output string, 228 Output-only text boxes, 63–64 OutputPrecision, 116 P Paint Picture, 73 Paint subroutine, 342, 347–349 PaintPicture, 349 Paradox, 203 PARAM statements, 375, 376, 380, 383–385 ParameterForm, 292–294, 305–307 ParseURL, 412, 416 Paste, 41 Path, 411 PeopleWatcher, 199–234 application, 261 commands, displaying, 218–219 key techniques, 203 summary, 234 understanding, 203, 213–233 usage, 199–203 PeopleWatcher Remote, 257–264, 283 key techniques, 257–258 summary, 264 Physical font, 116 PicGauge, 349–351, 355 Picture boxes, 224 Picture2D, 339, 340, 342, 345 object, 335 Picture3D, 339, 340, 342, 345 object, 335 Pictures, loading See Web PitchAndFamily, 117 Plain-text files, 124 POINTAPI, 122 Popup dialog, 79 Popups, 80, 87 PostScript optimization, 76 Predicate, 242 PresentTopic, 125 PresentURL, 125, 126 Print, 39–40 Print Dialog command, 75 Print preview, 5–6, 38, 39, 70 Print previewing, 53, 60, 69–73 Print setup, 38, 39, 43 dialog, 54 Print Setup command, PrintDocument, 69, 70 subroutine, 67, 68 Printer object, 65–69 Printer setup, providing, 54, 76–77 Printing, 5–6, 38, 53, 60, 64–65 See also Dialog dialog usage, 73–76 PrintMultiline, 69 subroutine, 67 PrintString, 69 subroutine, 66 Privilege tables, 226–227 Privileges, 254–255 Procedure IDs, 327, 328 ProcessAllCommands, 248–249 ProcessCommand, 250–252 ProcessSelect, 252–254 function, 299 Project Explorer, 320 Project options, setting, 143–145 Project properties See Visual Basic 4; Visual Basic Properties See Indexed properties; Standard properties; Visual Basic 4; Visual Basic Property See Enabled property Property IDs, 327 Property procedures, implementation, 319, 323–324 Property values See Default property values reading, 319, 325–326 writing, 319, 325–326 PropertyChanged subroutine, 323, 327, 334 PropertySetter, 139–159, 172, 175, 184 add-in, 161 installing, 139–140 key techniques, 141–142 summary, 159 usage, 140–141 ProtectChar, 401, 403 subroutine, 400, 402 Protocol, 410 Q Quality, 117 Query, 235–255 key techniques, 237 summary, 255 usage, 235–236 Query Server application, 308 QueryDef object, 237, 250, 252 QueryServer, 283–300, 302 application, 284, 301, 305 key techniques, 287 summary, 299–300 system, 285 usage, 285–286 QueryServerForm, 289 QueryUnload, 25, 26 event handler, 129 R RACM See Remote Automation Connection Manager Radio button values, getting, 391 Radio buttons, 390–392 creation, 390–391 resetting, 392 Read-only property, 323 ReadProperties, 384 ReadyToUnload, 91 subroutine, 123 Records copying, 212 creation, 211–212 deleting, 212 editing, 212, 219 selection, 206–207 Recordset objects, 208, 209, 212 data manipulation, 210–211 types, 210 Recordsets creation, 209–213 field, 252 RecordSource property, 258 Redo, 40 Redo accelerator, 40 References dialog, 274 Refresh, 43 command, 127 RegClass, 269 usage, 280–282 REGEDIT, 50 RegisterView subroutine, 108 Registry, 50 Relational databases, 207 Remote Automation Connection Manager (RACM), 277, 278, 280 Register menu, 279 Remote databases direct access, 258 usage See Data controls Remote tables attaching, 257, 259–264 manipulating, 263–264 Remote testing, 268, 275–279 RemoveRecentFile, 52 RemoveSegment, 400, 402–405 Repeat, 40 Replace, 42 Report building, 309–311 displaying, 312 Report object, starting, 309 Report parameters, getting, 305–306 ReportForm, 294–295,312 displaying, 311 ReportList, 286 building, 287–295 client, 303, 308 ReportLister object, 296 ReportListForm, 289–292, 308 Reports generating, 303, 308–311 requesting, 303, 305–308 scheduling, 308–309 RequestReport, 311 Resize event handler, 175, 178 Results, displaying, 303, 311–313 Right join, 244 Rows, controls alignment, 162, 166–172 ROWSPAN, 392 S Salary information, 201 Save, 39, 235 Save All, 39 Save As, 39, 235 command, 30 Save parameter, 212 SaveData, 24, 32–33 SaveDataAs, 30–32 SaveRecentFiles, 50, 51 Scale, 43 menu, 71 ScaleHeight, 10, 11, 68 ScaleLeft, 68 ScaleTop, 68 ScaleValue, 72 ScaleWidth, 68 Scaling, 76 ScheduleWakeup, 120 Scroll bars, 16, 17, 107, 111, 115, 119, 175 management, 73 Scroll events, 119, 359, 378 ScrollArea, 9–12, 14–16, 72 Scroller, 173–184 add-in, 137 key techniques, 175 summary, 184 usage, 173–175 Scrolling area controls, arranging, 175, 182–184 Scrolling areas, creation, 8–12, 175, 178–182 ScrollVC, 114–115 SDI See Single document interface SELECT, 242–246 statement, 207, 242, 244–246, 251, 252, 393 See also SQL SELECT statements Select All, 42 Select control values, getting, 394 Select controls, 393–394 creation, 393–394 resetting, 394 Select list, 243 SELECTED parameter, 393 SelectObject API function, 118 SendData, 397–398 Separators, 37–38 Server access, granting, 277–278 application, 285 building, 271–273 class, 273 compiling, 276 installation process, 268 installing, 276–277 registering, 277, 278–279 running, 273 Server DLL, 157 creation, 154–156 Set Values, 140, 141 SetScale subroutine, 72 SetterDialog, 148, 149 SetValues function, 150, 151 ShapeForm subroutine, 122 ShowAbout, 123 ShowPrinter method, 77 ShowSplash, 123 ShowValues subroutine, 363 Single document interface (SDI), 1, 18–20 applications, 39 documents, management, 9, 20–26 Single-form application, Site, 410–411 SiteMapper, 407–423 application, 367 key techniques, 408–409 modifying, 409, 422 summary, 423 usage, 407–408 SIZE parameter, 393 Small icons, 43 SmallChange, 12, 73 SortControls, 167 Source code, 7, 8, 321 Special menus, 47 Splash screens, 121 displaying, 54, 88–92 SPRY Mosaic, 376 SQL See Free-format SQL; Structured query language SQL SELECT statements, 235, 236, 296 SQL UPDATE statement, 231 SQL WHERE clause, 297 SQLServer applications, 286 building, 287, 297–299 example, 298–299 program, 296 Standard menus, 38–47 Standard properties, delegation, 319, 326–328 Start Time, 95 Status Bar, 42 StDev, 243 StDevP, 243 Stop Time, 95 StrikeOut, 116 StripCommands, 249–250 Structured query language (SQL), 294 commands, composing, 237, 239 property, 250 query, 285, 298 statements, 205, 207, 208, 210, 229, 231, 235, 239, 243, 247, 251, 258 processing, 237, 248–254 Style, 336–338 property, 355 Sub main building, 187–190 creation, 152–154 Submenus See Add-in submenus Sum, 243 Survey.HTM, data sending, 398 System-defined font, 68 T TableDef, 260, 262 object, 259 Tables, 392–393 See also Privilege tables; Remote tables detaching, 262 Tags, 129, 133 Task Manager, 96 TCP/IP network protocol, 278 Technical support, 46 Test application, 319–320 running, 322 Testing See Client; Local testing; Remote testing Text, formatting, 64 Text area values, getting, 395 Text areas, 394–395 creation, 394 getting, 395 Text box values, getting, 395 Text boxes, 54, 63, 111, 219, 225, 232, 236, 270, 395 See also Output-only text boxes; Visual Basic creation, 395 resetting, 395 Text Flow tab, 81 Text strings, 243 TEXTAREA statement, 394 TicGauge, 347–348, 355 TicSpacing, 351 Time Manager, 274 Time synchronization subroutines, 270 Timer control, 304 Timer event, 309 Timer event handler, 91, 120 TimeManager, 272, 280, 281 TimeSync, 267–282 client/server application, 267 key techniques, 268–269 server application, 267 steps, 269–279 summary, 282 troubleshooting, 268, 279–280 usage, 267–268 Tips, 46 Title bar, 121 Toolbar, 42 command, 42 TOP, 242 Topic file, creation, 79–81 Troubleshooting See TimeSync TYPE parameter, 390, 395 U Underline, 116 Undo, 40 Uniform Resource Locator (URL), 125, 397, 398, 407 See also PresentURL expanding, 409, 414–416 parsing, 409–414 understanding, 410–411 UNIX systems, 227 UNLOAD, 25 UnprotectChar, 402–405 UnregisterView, 109 UPDATE, 247 statement See SQL UPDATE statement UpdatePassword, 231–232 UpdateRecentFileMenu, 48–49, 51 URLHelpForm, 97, 125–128 URL See Uniform Resource Locator User interface, 63, 110 elements, 107, 396 style, 218 User passwords, 202, 227–228 User privilege checks, 297 User privileges, 226 UserControl, 322, 361 object, 320, 323–326, 338, 384 Users, interface customization, 223–228 V Validation, 212–213 See also Data; Field validations; Field-level validation; Form-level validation; Forms nonallowed values, 232–233 ValidMoney, 59 VALIGN statement, 392 Value, 114, 334 Value drag operation, 344 VALUE field, 383 VALUE parameter, 395 Value property, 345 ValueChanged event, 359, 365 Values See Check box values; Controls; Radio button values; Select controls values; Text area values; Text box values; Validation VALUES clause, 246 Var, 243 VarP, 243 vbAsyncTypeByteArray, 384 vbAsyncTypeFile, 384 vbAsyncTypePicture, 384 vbRightJustify, 64 VBScript, 378 code, 370, 372, 376, 377, 390, 395, 396 event handler, 382 Vertical tiling, 45 VerticalText, 118 View/controllers, 111–113 View, 42–43 Viewport, 9, 10, 13, 14, 174 Views, 106–108, 110–111 notification, 108–110 VisitURL subroutine, 421 Visual Basic, 9, 15, 25, 26, 36, 47, 64, 74, 101, 105, 109, 139, 182, 219, 304, 325, 391 See also Microsoft Visual Basic add-in, 204 Add-Ins menu, 140 application, 37, 54, 82, 85, 143, 370 asynchronous servers, building, 303, 304 bitwise NOT operator, 103 code, 113, 207, 273, 396 development environment, 14, 137, 144–146, 157 Environ, 399 help, 203 help file usage, 84–85 Load command, 360 Load statement, 292 Menu Editor, 75 program, 237, 380 programmers, 140 programming environment, 143, 157, 158, 280 programming methods, 93 programming techniques, 203 source code, 188, 208 techniques, 100 text boxes, 41 Visual Basic project files, 26 Visual Basic 4, 26, 83, 139, 142, 156, 275 class properties, 145–146 Data Manager, 263 Development Environment, 147, 153 Object Browser, 155 project properties, 143–144, 271–272 Visual Basic 5, 139, 142, 155, 156 class properties, 146 compact disk, 78, 83 development environment, 154 Enterprise Edition, 78 Extensibility reference, 147 project properties, 144–145, 272–273 Setup Wizard, 276, 375 Visual Data Manager, 262, 263 Visual data manager, attaching, 263 W WaitEnd, 54, 55 WaitStart, 54, 55 Web, ActiveX controls, 369–385 key techniques, 370–372 safe use, ensuring, 371–374 summary, 385 usage, 369–370 Web, ActiveX usage, 367–423 Web, pictures loading, 384–385 Web browser, 370, 418 Web client program, 423 Web data receiving, 389, 399–400 sending, 390, 396–398 Web documents, 369 retrieving, 409–410 Web page author, 373 Web page designer, 369, 371 Web pages, 367, 369, 372, 378, 387, 407 building, 389–396 Web sites, 410, 411 mapping, 409, 416–422 Web-based application, 355 Web-based help system, 78 WebBrowser, 125, 127, 130 control, 93 WebLabel control, 369, 379 WebSurvey, 387–405 application, 367, 389, 405 key techniques, 389–390 summary, 405 usage, 387–389 Weight, 116 What-you-see-is-what-you-get (WYSIWYG) interface, 218 WHERE clause, 207, 245–248, 297, 299 See also SQL WHERE clause WidGauge, 348–349, 355 Width, 116, 374 properties, 77 Window, 44–45 Window list, 45 WindowList property, 45 Windows 3.x style help, 85–86 Windows 95, 18, 85, 277, 420 style help, 86–88 task manager, 309 Windows API, 122 function, 115 Windows Explorer, 43, 83, 276 Windows navigation features, Windows NT, 18, 152, 420 Windows Registry, 32, 374 WindowState, 13 Workspaces, 209 World Wide Web, 124 WriteProperties, 325, 333, 384 event handler, 326 WriteProperty subroutine, 325 WYSIWYG See What-you-see-is-what-you-get Z ZOrder method, 224 Previous Table of Contents Next Products | Contact Us | About Us | Privacy | Ad Info | Home Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc All rights reserved Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited Read EarthWeb's privacy statement ... titles Advanced Visual Basic Techniques Go! Keyword Brief Full Advanced Search Search Tips (Publisher: John Wiley & Sons, Inc.) Author(s): Rod Stephens ISBN: 04711888 16 Publication Date: 06/ 01/97... titles Advanced Visual Basic Techniques Go! Keyword Brief Full Advanced Search Search Tips (Publisher: John Wiley & Sons, Inc.) Author(s): Rod Stephens ISBN: 04711888 16 Publication Date: 06/ 01/97... titles Advanced Visual Basic Techniques Go! Keyword Brief Full Advanced Search Search Tips (Publisher: John Wiley & Sons, Inc.) Author(s): Rod Stephens ISBN: 04711888 16 Publication Date: 06/ 01/97

Ngày đăng: 23/05/2018, 15:44

TỪ KHÓA LIÊN QUAN