VBµÄÀ×´ïɨÃè
×Ô¼ºÕûÁË4¸öÄ¿±êÓÃÓÚɨÃè¡£ÒÔºó¿ÉÄÜ¿ÉÒÔ×Ô¼ºÌí¼Óɾ³ý£¨Ð´µ½Õâ¶ùºöÈ»¾õµÃC++µÄvector²»ÄÜɾ³ýÔªËØ£¨·´ÕýC++ PrimerÀïĿǰûÕÒµ½£©ÈÃÈ˺ÜÓôÃÆ£©
Form1£¬Ðë¼ÓÒ»¸öTimer1
Dim CAngle As Integer 'Current Angle (Not Class Angle)
Private Sub Form_Load() '³õʼ»¯
CAngle = 0
Me.BackColor = vbBlack
Me.BorderStyle = 3
Me.FillColor = vbYellow
Me.ForeColor = vbGreen
Me.FillStyle = 1
Me.ScaleMode = 3 'Pixel
Me.Width = 4590
Me.Height = 4980
Timer1.Interval = 10
End Sub
Private Sub Timer1_Timer()
Cls
Circle (150, 150), 130
If CAngle = 359 Then CAngle = 0 Else CAngle = CAngle + 1
Raida CAngle '»æÖÆÀ×´ï
RaidaTarget 0.5, 20 '¶¨ÒåÀ×´ïÄ¿±ê1
RaidaTarget 0.7, 200 '¶¨ÒåÀ×´ïÄ¿±ê2
RaidaTarget 0.2, 100 '¶¨ÒåÀ×´ïÄ¿±ê3
RaidaTarget 0.9, 257 '¶¨ÒåÀ×´ïÄ¿±ê4
End Sub
Private Sub Raida(ByVal angle As Integer) '¸ù¾ÝËù¸ø½Ç¶È»æÖÆÀ×´ï
Dim x As Single, y As Single, a As Single, _
ae As Single, g As Integer
g = 0
ae = angle - 45
For a = ae To angle
x = Cos(D2R(a)) * 130 + 150
y = Sin(D2R(a)) * 130 + 150
g = (a - ae) / 20 * 255
Line (150, 150)-(x, y), RGB(0, g, 0)
Next a
End Sub
Private Sub RaidaTarget(ByVal Row As Single, ByVal Thita As Integer) '¸ù¾ÝÀ×´ïɨÃèÇøÓò»æÖÆÄ¿±ê
Dim x As Integer, y As Integer
x = Cos(D2R(Thita)) * Row * 130 + 150
y = Sin(D2R(Thita)) * Row * 130 + 150
Form1.FillStyle = 0
If Me.Point(x, y) <> 0 Then Circle (x, y), 5, RGB(255, 255, 0) 'Èç¹ûÀ×´ïɨµ½Ä¿±êÔòÏÔʾ
Form1.FillStyle = 1
End Sub
Module1
Public Function D2R(ByVal d As Integer) As Single
D2R = CDbl(d) * (3.14159265359 / 180)
End Function
'òËÆû±ØҪרÃÅŪһ¸öÄ£¿éÈ¥×°Õâôһ¸öС¶«Î÷
Ïà¹ØÎĵµ£º
Õ⼸ÌìÒ»Ö±ÔÚ×öÒ»¸öСµÄ¹¤³Ì,×öÒ»¸öÎı¾ÔĶÁÆ÷,ÏÖÔÚ×öµÄÒѾÓÐÈý·ÖÖ®¶þÁË,´ÓÖÐѧϰµ½Á˺ܶà,¶ÔÎÒÃÇÒÔǰѧϰµÄ³É¹ûÓÐÁ˸üÉî¿ÌµÄÀí½â.
VBÊÇÒ»ÃÅÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼Æ,ÎҾʹÓÃæÐÔ¶ÔÏóµÄ½Ç¶È¶ÔËû×öÒ»´Î×ܽá
°ÑVBÖÐËùÓеÄÊý¾Ý,±äÁ¿,¿Ø¼þ¶¼¿´×öÒ»¸ö¶ÔÏó
ÎÒÃÇËùÓеIJÙ×÷¶¼ÊǶԶÔÏóµÄ²Ù×÷,ÈöÔÏóÈ¥Ö´ÐÐijһ¸ö¹¦ÄÜ
´ó¼ÒÏÈ¿´Ò»¸öÀý× ......
Private Function NMoneyToSMoney ( NMoney As Variant ) As String
If IsNumeric ( NMoney ) = False Then
NMoneyToSMoney = "²»ÊÇÊý×ÖÀ ......
ÉÏÎçÏÈ°ÑÖ÷°åÊõÓï°¤¸ö²éÁËÒ»±é£¬Á˽âËüµÄËõдÓÉÀ´¡¢Î»Öú͹¦ÄÜ¡£
Ö÷°åÓ¢ÎÄËõдÏê½â£º
http://user.qzone.qq.com/904515106/infocenter?ptlang=2052&ADUIN=904515106&ADSESSION=1272977059&ADTAG=CLIENT.QQ.2653_Mysrv.0
ÏÂÎç·µ¹¤£¬Õâ´Î¸øµÄ½ÌѵÊDzÒÍ´µÄ£¬ÎÒÃÇ×éÊÔÁË°ëÌ춼²»ÄܵãÁÁ£¬»»Ó²ÅÌ·&mi ......
VB Winsock StateÊôÐÔÖµ
'winsock ״̬³£Êý
'sckClosed 0 ¹Ø±Õ״̬
'sckOpen 1 ´ò¿ª×´Ì¬
'sckListening 2 ÕìÌý״̬
'sckConnectionPending 3 Á¬½Ó¹ÒÆð
'sckResolvingHost 4 ½âÎöÓòÃû
'sckHostResolved 5 ÒÑʶ±ðÖ÷»ú
'sckConnecting 6 ÕýÔÚÁ¬½Ó
'sckConnected 7 ÒÑÁ¬½Ó
'sckClosing 8 ͬ¼¶ÈË ......
Private Function Utf8ToUni(B() As Byte) As String
'²»Ê¹Óà API£¬½« Utf8 ת»»Îª Unicode
Dim BU As Long
On Error Resume Next
BU = -1: BU = UBound(B)
If BU = -1 Then Exit Function
On Error GoTo 0
&n ......