Illustrates how to play a wave file in Visual Basic. Illustrates two simple sketchpads. A simple object-oriented drawing editor that allows a user to create, move and erase squares.
The program illustrates how to do simple object-based interactive graphics in VB how to use a collection how to use a class. This program is similar to the drawing editor above, but used for completely different purposes.
Illustrates how to create a very simple table lens that toggles cells between graphical and textual views.
Illustrates how to Bitblit a picture on another picture, and how to drag it around. Illustrates how to use the Tree control and how to drag items around different parts of the tree. An example application that lets a user interactively move different kinds of controls on a display. Illustrates how to create a simple class that raises events. Illustrates a database with the flex control. Illustrates how you can clip the shape of a control or form to a variety of regions.
A tutorial and example project that shows you how to build a TickerTape control out of a label. A VB ActiveX Control that creates a 'new' type of button actually a standard but augmented command button that moves away from the person who is trying to click it. This program creates a command button that will follow the mouse around. This simple but very useful example illustrates using the Extender object in a VB UserControl to access outside properties and methods the use of calls from the Win32 API for finding mouse cursor coordinates scaling those coordinates in terms of a container object be it a form or another control container.
Illustrates a very crude range slider written in ActiveX. A tutorial program that shows you how to use the PictureClip component for creating animations. Dave Miller , student. An activeX control plus exe that shows you how to find the other controls in a form from inside an ActiveX control. Illustrates how you can build a transparent ActiveX Control that lets you detect clicks on a non-rectangular image in the figure on the right these would be the red letters.
Mike Rounding, Shaun Kaasten. Similar to xparent. Mike Rounding,. This example includes a user control that will move itself towards any other control. Mike Rounding. Bitmap Animation: Shows how to build a simple bitmap animation. Transparency: A tool library to do transparency, including transparent controls. Return a dialog handle-class name from a caption. Return the selected contents of a multiselect list box.
Returning a files creation time. Search a treeview for a item. Search in Listbox. Searching a window for a child window. Searching the contents of a listview. Set text selected when entering a textbox. Set the mouse cursor for a form. Setting the tab positions in a listbox. Sort, Select and Return the selected items from a ListView. Unload all forms currently in memory. Use a horizontal scrollbar with a listbox. Use of the ProgressBar Control. ReadLine is used to read the next line here we are using it to hold the screen.
Declare a variable in visual basic is really simple. Dim str As String is a variable decoration. Where str is a variable of string type. Below is the code to Concat two string in visual basic. Which contains 3 strings str1, str2,str3. NET language has class inheritance. The HelloWindows class inherits from the Form class, which is defined in the System. Forms namespace. Class inheritance and the Inherits statement are discussed in Chapter 2.
The next line declares a label control that will be used for displaying the text Hello, Windows :. As is the case with console applications, GUI applications must have a shared subroutine called Main :. This Main method creates an instance of the HelloWindows class and passes it to the Run method of the Application class defined in the System.
The Run method takes care of the housekeeping of setting up a Windows message loop and hooking the HelloWindows form into it. Like Main , New has special meaning to the Visual Basic. NET compiler. Subroutines named New are compiled into constructors. A constructor is a method that has no return value but can have arguments and is automatically called whenever a new object of the given type is instantiated.
Constructors are explained further in Chapter 2. The interesting thing to note is how different this is from how Visual Basic 6 represented form design. In Visual Basic 6, form layout was represented by data in.
This data was not code, but rather a listing of the properties and values of the various elements on the form. NET, this approach is gone. Instead, Visual Basic. NET statements must explicitly instantiate visual objects and set their properties.
When forms are designed in Visual Studio. NET using its drag-and-drop designer, Visual Studio. NET creates this code on your behalf. The command line to compile the Hello, Windows program is:. The command line for compiling the Hello, Windows program has more stuff in it than the one for the console-based hello, world program. In addition to specifying the name of the. NET command-line compiler includes two references implicitly: mscorlib. Creates a console application. The generated file has an extension of.
This is the default. Creates a GUI application. Creates a class library. The output of Hello, Windows is shown in Figure
0コメント