Book contents
- Frontmatter
- Contents
- Preface
- 1 Fundamentals of Design and Programming – Starting from Scratch
- 2 Variables and Constants – A Place for Everything and Everything in Its Place
- 3 Writing Programs – First You Walk, Then You Run
- 4 Writing Programs II – More Controls and New Logic
- 5 Using If and Case – Decisions, Decisions, Decisions
- 6 Loops – Once Is Not Enough
- 7 Procedures and Functions – Divide and Conquer
- 8 Writing Programs III – Tying It All Together, So Far
- 9 File I/O – Files and Records and Fields, Oh My!
- 10 Arrays and Structures – Organizing Data
- 11 Events and More Controls – Tips and Tricks for Programming
- 12 Objects and Classes – Objects Are in a Class By Themselves
- 13 Graphics – The Visual (and Audio) Side of Visual Basic
- 14 LINQ to SQL – The World Runs on Databases
- 15 Crystal Reports – Tying Databases to Output
- Appendices
- Index
11 - Events and More Controls – Tips and Tricks for Programming
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- 1 Fundamentals of Design and Programming – Starting from Scratch
- 2 Variables and Constants – A Place for Everything and Everything in Its Place
- 3 Writing Programs – First You Walk, Then You Run
- 4 Writing Programs II – More Controls and New Logic
- 5 Using If and Case – Decisions, Decisions, Decisions
- 6 Loops – Once Is Not Enough
- 7 Procedures and Functions – Divide and Conquer
- 8 Writing Programs III – Tying It All Together, So Far
- 9 File I/O – Files and Records and Fields, Oh My!
- 10 Arrays and Structures – Organizing Data
- 11 Events and More Controls – Tips and Tricks for Programming
- 12 Objects and Classes – Objects Are in a Class By Themselves
- 13 Graphics – The Visual (and Audio) Side of Visual Basic
- 14 LINQ to SQL – The World Runs on Databases
- 15 Crystal Reports – Tying Databases to Output
- Appendices
- Index
Summary
VB Quip
The function of good software is to make the complex appear to be simple.
– Grady BoochGood software does just that. It's easy to use, “intuitive” is the buzzword used in the industry. It does what it should and people actually like using it. Developers must keep two things in mind: getting the program to do what it should and making it useable – the two go hand-in-hand. A cool interface means nothing if the software doesn't perform. And, no matter how solid the code is, a clunky program is nearly worthless. Always think of both form and function. On the one hand, a developer must write code that works. On the other, a developer must always consider the end user. Never forget, you can't have one without the other!
New Events
You're familiar with several events such as Click, Load, and Scroll, but there are more, many more. In fact, there are far too many to cover in anything short of the dreaded user's manual. Every event can trigger code and every user action raises an event, that is, every time the user does something, from a click of the mouse to a peck of a key, a program can respond. How it responds and what it does are key to good software.
KeyPress
When a key is pressed, it generates a KeyPress event and also several other key events.
- Type
- Chapter
- Information
- Programming in Visual Basic 2010The Very Beginner's Guide, pp. 429 - 474Publisher: Cambridge University PressPrint publication year: 2010