vbʹÓÃpicturebox»ÇúÏßͼ
'Ìí¼Ó¸öpicture1ºÍcommand1
Option Explicit
Dim lngCenter As Long
Dim lngMax As Long
Dim lngPad&
Dim PCurrent As POINT, PLast As POINT
Private Type POINT
x As Long
y As Long
End Type
Private Sub Form_Load()
lngCenter = (Picture1.Top + Picture1.Height) / 2
lngMax = Picture1.Height
PLast.x = 0
PLast.y = lngCenter
Dim i&
For i = 0 To Picture1.Width Step 100
Picture1.Line (i, 0)-(i, Picture1.Height), &HFFC0C0
Next
For i = 0 To Picture1.Height Step 100
Picture1.Line (0, i)-(Picture1.Width, i), &HFFC0C0
Next
Picture1.DrawWidth = 1.5
Picture1.Line (0, lngCenter)-(Picture1.Width, lngCenter), vbBlue
Picture1.DrawWidth = 1
End Sub
Private Sub Timer1_Timer()
PCurrent.x = PCurrent.x + 50
Randomize
PCurrent.y = Rnd * lngMax
Picture1.Line (PCurrent.x, PCurrent.y)-(PLast.x, PLast.y), vbRed
PLast.x = PCurrent.x
PLast.y = PCurrent.y
End Sub
Private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
End Sub
Ч¹ûͼ£º
Èç¹ûÐèÒª´øÓÐµã¹æÂÉÐÔ¿ÉÒÔ½«»ñµÃyµÄ×ø±êÉÔ¼Ó´¦ÀíÏ£º
Private Function getRndY() As Integer
Dim lngTmp%
If intRnd = 0 Then
Randomize
intRnd = Rnd * 3 + 1
End If
Randomize
lngTmp = Rnd * lngCenter
If PLast.y > lngCenter Then
getRndY = lngCenter + lngTmp
Else
getRndY = lngTmp
End If
intCurRnd = intCurRnd + 1
If intCurRnd > intRnd Then
Randomize
intRnd = Rnd * 3 + 1
&nb
Ïà¹ØÎĵµ£º
ÏàÐÅÏÖÔÚ¾ø´ó¶àÊý¼ÆËã»úÉÏʹÓõÄÊÇIEä¯ÀÀÆ÷¡£ÈçºÎͨ¹ý±à³Ì¿ØÖÆIEµÄ²Ù×÷ÄØ£¬±¾ÎĽ«Ò»²½²½½éÉÜÈçºÎͨ¹ýVB
µ÷ÓÃIEµÄ¶ÔÏó¿âÀ´¶ÔIE½øÐпØÖÆ¡£
±¾ÎÄʹÓõıà³Ì¹¤¾ßÊÇVB6Ó¢ÎÄÆóÒµ°æ£¬ä¯ÀÀÆ÷ÊÇIE5£¬ÒÔϵĴúÂëÖ»ÄÜÔÚIE4¼°ÒÔÉϰ汾ÏÂÔËÐС£ÁíÍâΪÁËÄÜÉî
ÈëÁ˽â³ÌÐò´úÂ룬×îºÃÄܰ²×°MSDN¡£ ......
·ÖÀࣺVBѧϰ ×ֺţº ´ó´ó ÖÐÖРСС mid(×Ö·û´®£¬´ÓµÚ¼¸¸ö¿ªÊ¼£¬³¤¶È) ÔÚ[×Ö·û´®]ÖÐ[´ÓµÚ¼¸¸ö¿ªÊ¼]È¡³ö[³¤¶È¸ö×Ö·û´®]
ÀýÈç mid("СÐÀÎÞµÐ",1,3) Ôò·µ»Ø "СÐÀÎÞ"
instr(´ÓµÚ¼¸¸ö¿ªÊ¼,×Ö·û´®1,×Ö·û´®2) ´Ó¹æ¶¨µÄλÖÿªÊ¼²éÕÒ£¬·µ»Ø×Ö·û´®2ÔÚ×Ö·û´®1Öе ......
Option Explicit
Private Declare Function LoadCursor Lib "user32.dll" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32.dll" (ByVal hCursor As Long) As Long
Private Const IDC_HAND As Long = 32649
Private myHand_handle ......
Private Sub Command1_Click()
Dim MyComm As New ADODB.Command '¶¨ÒåÒ»¸öÃüÁî¶ÔÏó
Dim Rs_GetList As New ADODB.Recordset '¶¨ÒåÒ»¸ö¼Ç¼¼¯¶ÔÏó
Dim param As ADODB.Parameter ......
ÎÞÒâÖз¢ÏÖVB ForÑ»·µÄÒ»¸öÌØµã£ºÔÚÑ»·ÌåÖУ¬Æóͼ¸Ä±äÑ»·ÖÕÖ¹±äÁ¿Ê¹Ö®ÌáǰÍ˳öÑ»·ÊÇͽÀ͵ġ£
Private Sub Form_Load()
Dim s(0 To 4) As String
Dim N As Integer, i As Integer
s(0) = "²âÊÔ1"
s(1) = "²âÊÔ2"
s(2) = "²âÊÔ3"
s(3) = "²âÊÔ4"
s(4) = "²âÊÔ5 ......