| Start |
|---|
| Hello World in VB.NET Forms To show a message box when the form has been shown: Load() will be called first, and only once, when the form first loads. Show() will be called every time the user launches the form. Activate() will be called every time the user makes the form active. Load() will execute before Show() is called, but be warned: calling msgBox() in show can cause that msgBox() to execute before Load() is finished. It is generally a bad idea to depend on event ordering between Load(), Show(), and similar. |
| For Beginners Some things all beginners should know / do that will help them have a good start with VB .Net: Set the following Options: Use &, not + for string concatenation. (opens new window) Strings (opens new window) should be studied in some detail as they are widely used. Spend some time understanding Value and Reference Types (opens new window). Never use Application.DoEvents (opens new window). Pay attention to the 'Caution'. When you reach a point where this seems like something you must use, ask. The documentation (opens new window) is your friend. |
| Forms Timer The Windows.Forms.Timer (opens new window) component can be used to provide the user information that is not time critical. Create a form with one button, one label, and a Timer component. For example it could be used to show the user the time of day periodically. But this timer is not suited for timing. An example would be using it for a countdown. In this example we will simulate a countdown to three minutes. This may very well be one of the most boringly important examples here. After button1 is clicked, about three minutes pass and label1 shows the results. Does label1 show 180? Probably not. On my machine it showed 182.5! The reason for the discrepancy is in the documentation, "The Windows Forms Timer component is single-threaded, and is limited to an accuracy of 55 milliseconds." This is why it shouldn't be used for timing. By using the timer and stopwatch a little differently we can obtain better results. There are other timers that can be used as needed. This search (opens new window) should help in that regard. |
Read Article
https://develop.horje.com/learn/1434/reference