... 3
Chapter Overview 4
What Comes Next? 5
1
THE .NET REVOLUTION 7
A Brief History of VisualBasic7
Enter .NET 8
The Limitations of “Classic” VisualBasic 8
Visual Basic s Quirky Mix 8
Isolated Languages ... features VisualBasic 2005 fits the bill. In fact, it’s the Visual
Basic makeover many programmers have spent years waiting for.
This book provides a guided tour through the world of VisualBasic ... create Web Forms interfaces. You’ll
learn about ASP .NET in Chapters 12 and 13.
System .Windows. Forms
This namespace includes all the types you need for building the user
interface in a Windows...
... altered; VisualBasic .NET strips the Handles keyword and
arguments and tosses them. When you paste in your new control you’ll find that Visual
Basic .NET will create a new event handler for it ... &
tbSent.Text.ToString
End Select
End Sub
Unfortunately, the Index property that used to be passed along in “classic” Visual Basic
was dropped in VisualBasic .NET. Since the Index property did not ... a form and
expect the code to remain behind in your project. It does—at least most of it. In Visual
Basic .NET, when you delete or cut a control from a form, the event handlers already
coded for...
... Types 74
Changes to Operations 75
Assignment Shorthand 75
Converting Variables 75
Math 76
Random Numbers 76
Some New Rules for Scope 76
Short-Circuit Logic 77
Quickly Skipping Through a Loop 78
Enhanced ... 106
Modal Forms 1 07
The Startup Form and Shutdown Mode 108
Application Events 108
Form Oddities 110
The Inner Workings of Forms 111
Visual Basic 6 Forms “Under the Hood” 112
Visual Basic 2005 Forms ... The .NET Revolution 7
Chapter 2: The Design Environment 19
Chapter 3: VB 2005 Basics 47
Chapter 4: Windows Forms 87
Chapter 5: Object-Oriented Programming 135
Chapter 6: Mastering Objects 173
Chapter...
... handful of language refinements are new in VisualBasic 2005, almost all
of the changes you’ll learn about in this chapter apply to all .NET versions of Visual
Basic. The most notable exception is ... is the
My object, which makes its debut in Visual
Basic 2005.
New in .NET
You might wonder what a chapter on basics is doing in a book designed for
developers who already understand details ...
events. The answer? VB 2005 and its predecessor, VB .NET, represent a
complete overhaul of the VisualBasic language. The changes from classic
Visual Basic range from minor tweaks all the way to a...
... with VisualBasic 2005. Complete reference information
for every control can be found in the class reference portion of the Visual
Studio Help, in the
System .Windows. Forms namespace. Or, for ... 12:39 PM
112 Chapter 4
Visual Basic 6 Forms “Under the Hood”
In VisualBasic 6, every form is stored in a file with the extension .frm, and
any binary information (pictures, for example) is stored ... PM
Windows Forms 1 17
Adding Controls Dynamically
A common question from VisualBasic programmers is how to add controls
to a form dynamically—in other words, while the program is running. For...
... a service used for all languages in the .NET Framework, and it’s radically
different from the way things used to work in VisualBasic 6.
Object Death in VisualBasic 6
Visual Basic 6 uses a ... supplies information through additional
parameters. Remember, the recommended format for a .NET event is a
parameter for the sender, combined with a parameter for the additional
information. ... This makes using them more straight-
forward and convenient than ever.
Collections and generics
Visual Basic 2005 goes one step further than VisualBasic .NET 1.x with
generics—a new feature...
...
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System .Windows. Forms.Control
System .Windows. Forms.ScrollableControl
System .Windows. Forms.ContainerControl
System .Windows. Forms.Form
bvb_02.book Page 188 Thursday, ... Inherits BaseForm
In other words, the DerivedForm class inherits from the BaseForm class
(which itself inherits from the
Form class). As a result, the DerivedForm is a
DerivedForm, a BaseForm, and ... DerivedForm.Designer.vb file, check out the class declaration.
Instead of seeing this:
Public Class DerivedForm
Inherits System .Windows. Forms.Form
you’ll see this:
Public Class DerivedForm
...
... Basic shares a Windows Form
engine with other .NET Framework languages so all of the source code that
you write with VisualBasic .NET is compatible with Visual C# .NET and Visual
C++ .NET (referring ... Is Visual Basic?
Visual Basic is a graphical programming language and the top of the class in
Rapid Application Development (RAD) tools for Windows. In fact, Visual Basic
is the most popular Windows ... languages). Here is the list of templates forVisual Basic:
n Windows Forms Application
n Class Library
Figure 2.1
Start Page in Visual Studio 2008.
26 Chapter 2
n
Visual Basic Primer
Block Buster . ....
...
End Sub
Giáo trình VisualBasic 6.0 143
Next
nd.Expande
Có thể viế
Private Sub Form_Load()
Dim DptStr
DptStr =
tu")
Dim nd As No
Set nd = tvw.Nodes.Add(
For i = 0 To 2
(i), ... hoạ tiến trình gán giá trị cho một mảng có 10
Dim A(1000) As Integer
Private Sub Form_Lo
Giáo trình VisualBasic 6.0 146
Nguyễn Đăng Quang
.ListIndex = 0
End With
End Sub
lick()
TickF ... s
lider1.SelLength = 0
tartSelection = Slider1.Va
Giáo trình VisualBasic 6.0 144
Nguyễn Đăng Quang
Ví dụ:
In giá trị Key và Text lên tiêu đề form khi người sử dụ
Private Sub tvw_NodeClick(ByVal...
... đang chọn
0-dtpLongDate . Ví dụ Friday, Nov 14, 1 972
2-dtpTime. Ví dụ 5:31: 47 PM
3-d
Giáo trình VisualBasic 6.0 138
Nguyễn Đăng Quang
FormattedString = "th"
Size = 2
nd ...
tpCust
“MM
08:24:24
.Format = dtpCust
mFormat = “MM
ẽ cho kết quả: January/Monday/1999
dtpDate.Format = dtpCust
dtpCustomFormat = “dddd
ay , February 14,
dtpDate.Format = dtpCust ết quả: ... cho k
Giáo trình VisualBasic 6.0 129Giáo trình VisualBasic 6.0 129
Định nghĩa Toolbar
- Định ngĩa ImageList chứa danh sách hình sẽ sử dụng trên Toolbar,
- Đặt Toolbar lên form,
- Trong hộp...
... report
With lvw
For i = 1 to .ColumnHeaders.Count
Debug.Print .ColumnHeaders(i).Text
Next
End with
3. Các phương thức
Giáo trình VisualBasic 6.0 1 17
Chương 12
Microsoft Windows Common ...
ComboItems: Th
Giáo trình VisualBasic 6.0 122
Nguyễn Đăng Quang
Private Sub Form_Load()
Dim clm As ColumnHeader
Dim itm As ListItem
Dim i As Integer
For i = 1 To 3
Set clm = ListView1.ColumnHeaders.Add() ... Listview - Imagecombo
Windows Common Controls là tên gọi chung của các loại đối tượng điều khiển chỉ
có trong Windows 9x. Các đối tượng này chứa trong thư viện Microsoft Windows
Common Controls....