... LiB ]
Using theVisualBasic Editor
Before you can write VBA macros, you need an editor. Outlook, like the other Office
applications, includes theVisualBasic Editor. Open the editor interface ... Use the
Properties window to change the form name, title, and other attributes.
The VisualBasic Editor interface includes the Project and Properties browsers, the main
code window, and the ... or use the Insert button on the Standard toolbar and
choose UserForm. Drag the lower-right corner to make the form a little bigger.
2. Enter a name for the form in the (Name) field of the Properties...
... DataRow
If Asc(e.KeyChar) = 13 Then
' nhap
If bien_chon = 1 Then
row = dataSet1.Tables("table1").NewRow
If Len(Trim(TextBox3.Text)) > 0 Then
row("ID") = TextBox1.Text
... End If
End If
' ngày sinh
If queryString1.Length = 0 Then
str1 = Trim(TextBox7.Text) 'họ tên
If str1.Length > 0 Then
dong_dkien = "ngay_sinh like " + "'" ... thu nhâp
If (queryString1.Length = 0) Then
str1 = Trim(TextBox8.Text) '
If (CheckBox1.Checked = True And str1.Length > 0 And IsNumeric(str1))
Then
dong_dkien = "thu_nhap >="...
... mở rộng cho Visual
Basic tức là khi xây dựng một ứng dụng nào đó đã có một số yêu cầu mà Visual
Basic cha đáp ứng đủ, ta viết thêm DLL phụ trợ.
Khi viết chương trình bằng Visual Basic, chúng ... ngôn ngữ mới nhất là VisualBasic 6.0 hỗ
trợ nhiều tính năng mạnh như OLE DB để lập trình dữ liệu. Các lập trình viên
đã có thể dùng VisualBasic 6.0 để tự mở rộng Visual Basic.
Phí Xuân Nam ... Subroutines)
Visual Basic đa ra phương pháp lập trình mới, nâng cao tốc độ lập trình.
Cũng như các ngôn ngữ khác, mỗi phiên bản mới của VisualBasic đều chứa
đựng những tính năng mới chẳng hạn như Visual...
... The View tab uses a CrystalReportViewer object on the tab page.
Steps
Open and run theVisualBasic .NET-Chapter 10 solution. Click on the button labeled
How-To 10.4. Clicking on the tabs, ... using tools such as the Viewer in a tabbed form, the tab pages
can become cluttered. If you want to limit the power of the Viewer or make it more
10.4 Select Whether the Report Will Be Displayed, ...
7. Add the code in Listing 10.2 to the Click event of btnExport. This code tests the
value of lstExportType and assigns the appropriate ExportFormatType and file
extension (strExt). The DiskFileDestinationOptions...
... ngay Then
If Val(so) < Val(so1) Then
so = so1
End If
End If
madh = cngay & "DH" & Right("00" & so, 3)
Loop
End If
Loop
If strMaSDH = "" Then
... drSqldataReader.GetString(0)
Dim tng As Date = drSqldataReader.GetDateTime(2)
If tng = ngay Then
flag = False
End If
If flag Then
madh = cngay & "DH001"
' Exit Function
Else
'ngay ... Chương 3: Cài đặt
Dim cngay As String
cngay = Right("0" & Microsoft.VisualBasic.Day(ngay), 2) &
Right("0" & Month(ngay), 2) & Right(Year(ngay),...
...
TRUYỀN THEO ĐỊA CHỈ VÀ TRUYỀN THEO GIÁ TRỊ
Bước 1: Tham số đưa vào chương trình con được truyền theo một trong 2 cách: theo
địa chỉ và theo giá trị. Bây giờ ta tạo dự án mới trong thư mục Basic\ Bt2-4 ... Visual Basic, Chương 6.
Tài liệu tham khảo:
VisualBasic 6 Certification Exam Guide - Chapter 3, Page 69 - Dan
Mezick & Scot Hillier - McGraw-Hill - 1998.
http://www.vovisoft.com/VisualBasic/VB6Chapter12C.htm
... mục Basic\ Bt1II-3. Tạo dự án mới VB Standard EXE trong thư mục
trên, sau đó tạo Form có dạng sau:
TT. VisualBasic
Bài tập 2-2
ĐỒ HỌA VỚI BASIC
Bước 1: Tạo một dự án mới trong thư mục Basic\ Bt2-2....
... nhẫy àïën TextBox cố Property
TabIndex value theo thûá tûå sau TabIndex value ca TextBox vûâa rúâi khỗi.
Thûúâng thûúâng ta cho TabIndex value theo thûá tûå tûâng cùåp LblName, txtName
rưìi ...
rưìi bêëm 'Ctrl+Space' (nhêën nt 'Ctrl' trong khi bêëm Space bar), VBIDE (Visual
Basic Integrated Development Environment) sệ àấnh nhûâng chûâ côn lẩi ca
chûâ 'SendKeys'. ...
If TypeOf Source Is ListBox Then
Msgbox " Drag source is a ListBox"
End If
Ta cq•ng cố thïí dng Name ca Source nhû:
If Source.Name = "List1" thenMsgBox "Drag source...
... sau:
Const PI As Double = 3.14159265
Label1.Text = PI
8. Làm việc với toán tử trong VISUAL BASIC. NET
Visual Basic. NET cung cấp các toán tử cơ bản sau:
Toán tử Mô tả
+ Phép cộng
- Phép trừ
* Nhân
/ ... RadioButton2.Checked = True Then
TextBox3.Text = value1 - value2
End If
If RadioButton3.Checked = True Then
TextBox3.Text = value1 * value2
End If
If RadioButton4.Checked = True Then
TextBox3.Text ... TextBox2.Text = "" Then
MsgBox("Bạn cần nhập đầy đủ hai giá trị")
Else
value1 = CDbl(TextBox1.Text)
value2 = CDbl(TextBox2.Text)
If RadioButton1.Checked = True Then
TextBox3.Text...