adv. access
DESCRIPTION
Adv. Access. Label. เป็นคอนโทรลสำหรับพิมพ์หรือแสดงข้อความ. Name Alignment AutoSize BorderStyle. Caption Left Top. Label (properties). TextBox. เป็นคอนโทรลที่ใช้รับข้อมูลที่เป็นตัวอักษรจาก Keyboard ของผู้ใช้. Text Box (properties). TabIndex เริ่มที่ 0 TabStop Text ToolTipText. - PowerPoint PPT PresentationTRANSCRIPT
[email protected][email protected]
Adv. Access
[email protected][email protected]
Label (properties)
•Name•Alignment
•AutoSize
•BorderStyle
•Caption•Left•Top
[email protected][email protected]
TextBoxเป็�นคอนโทรลท��ใช้�ร�บ
ข้�อม!ลท��เป็�นตั�วอ�กษรจ กKeyboard ข้องผู้!�ใช้�
[email protected][email protected]
Text Box (properties)•Name
•MaxLenght
•Multiline
•PasswordChar
•ScrollBars
•TabIndex เร��มท�� 0
•TabStop•Text•ToolTipText
[email protected][email protected]
Command Button
เป็�นคอนโทรลท��ท� หน� ท��เป็�นป็'(มสำ� หร�บร�บค� สำ��งจ กผู้!�ใช้�
[email protected][email protected]
ตั�วอย่* งง นห ผู้ลค!ณระหว* ง 2 Text Box
Sub Command1_Click() a = Text1 b = Text2 Label3.Caption = a & " * " & b & " = " & a * bEnd Sub
[email protected][email protected]
ตั�วอย่* งง นห ผู้ลค!ณระหว* ง 2 Text Box
[email protected][email protected]
Sub Command1_Click() a = Text1 b = Text2 Label3.Caption = a & " * " & b & " = " & a * bEnd Sub
Source Code
[email protected][email protected]
Operator ท งคณ�ตัศ สำตัร� น�พิจน� คว ม
หม ย่ + บวก - ลบ * ค!ณ / ห ร \ ห ร
จ� นวนเตั.ม Mod
ห รเอ แตั*เศษ ^ ย่ก
ก� ล�ง
[email protected][email protected]
ตั�วอย่* งง นก รท� ง นก�บ Operator ท งคณ�ตัศ สำตัร� Sub Command1_Click()Dim a As IntegerDim b As Integera = Text1.Textb = Text2.TextLabel3.Caption = a & " / " & b & " = " & a / bLabel4.Caption = a & " \ " & b & " = " & a \ bLabel5.Caption = a & " mod " & b & " = " & a Mod bLabel6.Caption = a & " ^ " & b & " = " & a ^ bEnd Sub
[email protected][email protected]
ตั�วอย่* งง นก รท� ง นก�บ Operator ท งคณ�ตัศ สำตัร�
[email protected][email protected]
Sub Command1_Click()Dim a As IntegerDim b As Integera = Text1b = Text2Label3.Caption = a & " / " & b & " = " & a / bLabel4.Caption = a & " \ " & b & " = " & a \ bLabel5.Caption = a & " mod " & b & " = " & a Mod bLabel6.Caption = a & " ^ " & b & " = " & a ^ bEnd Sub
[email protected][email protected]
Operator ท งก รเป็ร�ย่บน�พิจน� คว มหม ย่
= เท* ก�บ > ม กกว* > = ม กกว* หร�อเท* ก�บ< น�อย่กว* < = น�อย่กว* หร�อเท* ก�บ< > ไม*เท* ก�บ
[email protected][email protected]
ตั�วอย่* งง นก รท� ง นก�บ Operator ท งก รเป็ร�ย่บเท�ย่บ
Sub Command1_Click()Dim a As StringDim b As Stringa = Text1b = Text2Label3.Caption = a & " > " & b & " = " & (a > b)Label4.Caption = a & " < " & b & " = " & (a < b)Label5.Caption = a & " = " & b & " = " & (a = b)Label6.Caption = a & " <> " & b & " = " & (a <> b)End Sub
[email protected][email protected]
ตั�วอย่* งง นก รท� ง นก�บ Operator ท งก รเป็ร�ย่บเท�ย่บ
[email protected][email protected]
Sub Command1_Click()Dim a As StringDim b As Stringa = Text1b = Text2Label3.Caption = a & " > " & b & " = " & (a > b)Label4.Caption = a & " < " & b & " = " & (a < b)Label5.Caption = a & " = " & b & " = " & (a = b)Label6.Caption = a & " <> " & b & " = " & (a <> b)End Sub
[email protected][email protected]
If…Then…Else
Statement If เง��อนไข้ Then Statement
….……….. End If
ร!ป็แบบท�� 1
[email protected][email protected]
If…Then…Else StatementIf เง��อนไข้ Then
Statement .1.Else
Statement .2.End If
[email protected][email protected]
If…Then…Else
Statement If เง��อนไข้ Then Statement…Elseif เง��อนไข้ Then
Statement…Elseif เง��อนไข้ Then
…Else
Statement สำ'ดท� ย่End if
[email protected][email protected]
ก รค� นวณแบบม�เง��อนไข้
กรณ� 2 เง��อนไข้ ค� นวณโบน�สำเง��อนไข้ ด�งน�0 ถ้� เง�นเด�อนน�อย่กว* 10000 บ ท ได�ร�บโบน�สำ 40% ข้องเง�นเด�อน ถ้� เง�นเด�อน10000 บ ทข้20นไป็ ได�ร�บโบน�สำ 50% ข้องเง�นเด�อน
ตั�วอย่* งง น
[email protected][email protected]
IF txtsalary< 10000 then txtbonus = txtsalary*0.40Else txtbonus= txtsary *0.50End if
ตั�วอย่* งง น
[email protected][email protected]
ก รค� นวณแบบม�เง��อนไข้กรณ�ม กกว* 2 เง��อนไข้ ค� นวณโบน�สำเง��อนไข้ ด�งน�0 ถ้� เง�นเด�อนน�อย่กว* 10000 บ ท ได�ร�บโบน�สำ 40% ข้องเง�นเด�อน ถ้� เง�นเด�อน 10000 - 30000 บ ท ได�ร�บโบน�สำ 50% ข้องเง�นเด�อน ถ้� เง�นเด�อนม กกว* 30000 บ ท ได�ร�บโบน�สำ 70% ข้องเง�นเด�อน
ตั�วอย่* งง น
[email protected][email protected]
If txtsalary< 10000 thenTxtbonus = txtsalary*.40Elseif txtsalary<=30000 thenTxtbonus = txtsalary*.50Else txtbonus = txtsalary*.70End if
ตั�วอย่* งง น