









Set the ListIndex Without the Click Event
If you set the ListIndex property of a list-box or combo-box control, VB might generate an unwanted Click event. Instead of writing code to bypass the Click event, use SendMessage
If you set the ListIndex property of a list-box or combo-box control, VB might generate an unwanted Click event. Instead of writing code to bypass the Click event, use SendMessage
To explicitly erase the contents of a string object, you can use the member function erase(): void f(){ char key; string msg = “press any key to continue”; cout
Many VB programmers use the Option Explicit statement to make sure each variable has been explicitly declared before using it. This means you’ll always notice a misspelled variable, which if
If your app uses temporary files, store the file name(s) in the Registry as you create them. When you exit the program, delete the temporary file and its related Registry
You can access the topmost element (the one pushed the latest) of a stack container by using the member function top(): #include #include #include using namespace std;void main() { stack
This code creates a smart input box. Every time you type something into this text box, the first letters of your string are compared against the members of a hidden
By default, iostream objects display bool variables as 0 and 1. You can override the default setting by inserting the formatting flag boolalpha to the object stream. Consequently, the symbolic
The operator dynamic_cast comes in two flavors: one uses pointers and the other uses references. Accordingly, dynamic_cast returns a pointer or a reference of the desired type when it succeeds.
You’ve probably noticed that the display time stops when an application pops up VB’s built-in MsgBox. Although the system timer continues to tick, the timer control isn’t updated every second,