,,,
(: . . email: tofriend@list.ru)
...
, . , . , . , , , . VB , , . "" , " ", .
( ), . . "" .
" "
, . ...
PictureBox CommandButton. , .
:
Private Sub Form_Load()
' -
Command1.Caption = Int(9 * Rnd)
Command2.Caption = Int(9 * Rnd)
Command3.Caption = Int(9 * Rnd)
Command4.Caption = Int(9 * Rnd)
Command5.Caption = Int(9 * Rnd)
Command6.Caption = Int(9 * Rnd)
Command7.Caption = Int(9 * Rnd)
Command8.Caption = Int(9 * Rnd)
Command9.Caption = Int(9 * Rnd)
End Sub
, - .
. . , . .. , - .
...
Command1, :
Private Sub Command1_Click()
If Command1.Caption < Command2.Caption Then End
If Command1.Caption < Command3.Caption Then End
If Command1.Caption < Command4.Caption Then End
If Command1.Caption < Command5.Caption Then End
If Command1.Caption < Command6.Caption Then End
If Command1.Caption < Command7.Caption Then End
If Command1.Caption < Command8.Caption Then End
If Command1.Caption < Command9.Caption Then End
' , !
Command1.Visible = False
' - "" !
Command1.Caption = -1
End Sub
"" :
Private Sub Command2_Click()
If Command2.Caption < Command1.Caption Then End
If Command2.Caption < Command3.Caption Then End
If Command2.Caption < Command4.Caption Then End
If Command2.Caption < Command5.Caption Then End
If Command2.Caption < Command6.Caption Then End
If Command2.Caption < Command7.Caption Then End
If Command2.Caption < Command8.Caption Then End
If Command2.Caption < Command9.Caption Then End
Command2.Visible = False
Command2.Caption = -1
End Sub
. , "" :
Private Sub Command9_Click()
If Command9.Caption < Command1.Caption Then End
If Command9.Caption < Command2.Caption Then End
If Command9.Caption < Command3.Caption Then End
If Command9.Caption < Command4.Caption Then End
If Command9.Caption < Command5.Caption Then End
If Command9.Caption < Command6.Caption Then End
If Command9.Caption < Command7.Caption Then End
If Command9.Caption < Command8.Caption Then End
Command9.Visible = False
Command9.Caption = -1
End Sub
. , .
!
Index ...
Index Command1 0. Command2 Command1, . .
, .
, ! :
Private Sub Form_Load()
For i = 0 To 8
Command1(i).Caption = Int(9 * Rnd)
Next i
End Sub
Private Sub Command1_Click(Index As Integer)
For i = 0 To 8
If Command1(Index).Caption < Command1(i).Caption Then End
Next i
Command1(Index).Visible = False
Command1(Index).Caption = -1
End Sub
, , , (8,71 4,25 ).
, .
" - !"
, , , . . , , - . , , - . , .
! , Label (). . - . Index .
BackColor . Caption .
, :
Private Sub Form_Load()
For i = 2 To 10
Load Label1(i) '
Next i
End Sub
: " Load". . , " , , ". "". . ( ) () ? .
10 32768. ,
, , :
Private skolko As Integer '
:
Private Sub Form_Initialize()
Me.WindowState = 2 '
Label1(2).Left = Label1(1).Left + Label1(1).Width + 60 '
Label1(2).Visible = True
skolko = 2
End Sub
Private Sub Label1_Click(Index As Integer)
If Fix(skolko * Rnd) + 1 = Index Then
' "" -
Label1(skolko).Visible = False
skolko = skolko - 1
Else
' -
Label1(skolko + 1).Left = Label1(skolko).Left + Label1(skolko).Width + 60
Label1(skolko + 1).Visible = True
skolko = skolko + 1
End If
Select Case skolko '
Case 1
MsgBox " !": End
Case 10
MsgBox " .": End
End Select
End Sub
: " ... , , , , ". , , . , ? , ... .
. : . - - , - .
, .
, , ( ... "- - ..." ). , Label1(0), ... Ctrl + C, Ctrl + V ( ). . : Ctrl + V . Label1(9) Label1(8). . - False. Label1(1) Label1(0) .
. , "" - - Label1(1), ... , :
Private Sub Form_Load()
Me.WindowState = 2
skolko = 1
End Sub
Private Sub Label1_Click(Index As Integer)
If Fix(skolko * Rnd) + 1 = Index Then
' "" -
Label1(skolko).Visible = False
skolko = skolko - 1
Else
' " - "
skolko = skolko + 1
If skolko <> 10 Then Label1(skolko).Visible = True
End If
Select Case skolko '
Case 0
MsgBox " !": End
Case 10
MsgBox " .": End
End Select
End Sub
. 2,46 , - 8,57 . , ...
: , " "? , , , "" .
" "?
, " c ", " " .
, :
M, : 204, 192, 209, 67, 200, 194 ( ). , , .
:
Private Sub M_Click(Index As Integer)
M(Index).Caption = Chr(Index) ' - index Ascii-
End Sub
? -, M, Index ( 67, 192, 194, 200, 204 209). -, : "".
:
M(68).Caption=" 68 "
F5. ٸ . : " ". , , . M(67 to 209), M(68) - . "" .
, , " ", . , .
?
, ( ), / ( ). , , 32767 ( ). . .
?
, Index. , Index, , , , , Load. Unload.
, , Index.
(: . . email: tofriend@list.ru) ... ,
Copyright (c) 2024 Stud-Baza.ru , , , .