.


:




:

































 

 

 

 





, MsgBox InputBox , . , .

, . , . , , . :

³ . :

Private Sub cmdTryMe_Click()

Dim r As String

r = InputBox(" :")

If r = "̲Ͳ" Then

MsgBox ", !"

Else

MsgBox ", " & re & "!"

End If

End Sub

3. .

4. ̲Ͳ .

Select Case

List1.Text List1.Listlndex , Select Case .

______

Labell Caption () ̳

³

Font () Times New Roman, Bold,

14-point

Label2 Caption ()

Label3 Caption () ()

Label4 Caption () ()

BorderStyle 1 - Fixed Single

( ) ( )

ForeColor Dark red (-

)

( ) (&00000080&)

Commandl Caption ()

ϳ . . . Code Form_Load. :

Private Sub Form_Load()

List1.AddItem ""

List1.AddItem ""

List1.AddItem ""

List1.AddItem ""

List1.AddItem ""

End Sub

³ ᒺ, ᒺ List1.

Code List1_Click.

, , :

Private Sub List1_Click()

Label3.Caption = List1.Text

Select Case List1.ListIndex

Case 0

Label4.Caption = "Hello, programmer"

Case 1

Label4.Caption = "Hallo, Programmierer"

Case 2

Label4.Caption = "Hola, programador"

Case 3

Label4.Caption = "Ciao, programmatori"

Case 4

Label4.Caption = ", "

End Select

End Sub

³ ᒺ, ᒺ Command1. Code Commandl _Click. End , Code. MyCase.frm, MyCase.vbp. Start () MyCase. . . .

.

1. ?

2. ?

3. Select Case?

.

( ).

 

6

1.

.

2.

2.1. .

2.2. , .

 

.

Private Sub Command1_Click()

Dim Prompt, FullName

Prompt = " '"

FullName = InputBox(Prompt)

MsgBox (FullName)

End Sub

Private Sub Command1_Click()

End

End Sub

Private Sub Form_Load()

'

List1.AddItem "Integer"

List1.AddItem "Long integer"

List1.AddItem "Single precision"

List1.AddItem "Double precision"

List1.AddItem "Currency"

List1.AddItem "String"

List1.AddItem "Boolean"

List1.AddItem "Date"

List1.AddItem "Variant"

End Sub

Private Sub List1_Click()

'

Dim Birds%, Loan&, Price!, Pie#, Debt@, Dog$, Total

Dim Flag As Boolean

Dim Birthday As Date

'

Select Case List1.ListIndex

Case 0

Birds% = 37

Label4.Caption = Birds%

Case 1

Loan& = 350000

Label4.Caption = Loan&

Case 2

Price! = -1234.123

Label4.Caption = Price!

Case 3

Pie# = 3.1415926535

Label4.Caption = Pie#

Case 4

Debt@ = 299950.95

Label4.Caption = Debt@

Case 5

Dog$ = " "

Label4.Caption = Dog$

Case 6 '"" -1, "" - 0

Flag = True

Label4.Caption = Flag

Case 7 #

Birthday = #11/19/1963#

Label4.Caption = Format$(Birthday, "dddd, mmmm dd, yyyy")

Case 8

Price = 99.95

Label4.Caption = Price

End Select

End Sub

䳿 , , , . , , .

Private Sub Command1_Click()

Dim First, Second '

First = Val(Text1.Text)

Second = Val(Text2.Text)

If Option1.Value = True Then

Label1.Caption = First + Second

End If

If Option2.Value = True Then

Label1.Caption = First - Second

End If

If Option3.Value = True Then

Label1.Caption = First * Second

End If

If Option4.Value = True Then

Label1.Caption = First / Second

End If

End Sub

Private Sub Command2_Click()

End

End Sub

Code Command1_Click. - . , . - .

First = Val (Text1.Text)

Second = Val (Text2.Text)

Val . . , , . -, *,^, / , Visual Basic .

+ , . , Visual Basic First Second . Visual Basic ', , , . (, 100 + 17 10017.)

, Code , . (+) If...Then:

If Optionl. Value = True Then

Labell. Caption = First + Second End If

Value () True (), +, Labell. : If...Then Caption () ' Labell (ϳ).

If...Then

.

Private Sub Command1_Click()

UserName = InputBox(" '.")

If UserName = "" Then

MsgBox (" , ! ?")

Form1.Picture = LoadPicture("c:\1.bmp")

ElseIf UserName = "" Then

MsgBox (" , ! ?")

Form1.Picture = LoadPicture("c:\2.bmp")

Else

MsgBox ("! :")

End

End If

End Sub

.

1. Val?

2. ?

.

1. . , .

2. .

 

7

1.

.

2.

2.1. .

2.2. , .

:

Private Sub Command1_Click()

For = 1 To 10

Print "˲Ͳ ";

Next i

End Sub

 

Private Sub Command1_Click()

For i = 1 To 10

FontSize = 5 + i





:


: 2016-07-29; !; : 387 |


:

:

, .
==> ...

1604 - | 1399 -


© 2015-2024 lektsii.org - -

: 0.02 .