¤ÀÃþ |
¼ÐÃD |
¤j·N |
§@ªÌ |
¤é´Á |
¬yµ{±±¨î | ¦p¦ó°»´ú¥Xµ{¦¡³´¤J¤FµL GOTO | ¡@ | ¦Ñ©Ç | 1998/9/21 |
¬yµ{±±¨î | «ö¤@Áä¦A°õ¦æ | ¼ÒÀÀ getch() | ¦Ñ©Ç | 1998/9/21 |
¬yµ{±±¨î | ¦h°j°é¦P®É¶i¦æ | ¡@ | ¦Ñ©Ç | 1998/10/14 |
ª«¥ó¨Ï¥Î | ¦p¦ó¨D¨ú Forms ªº Index È | Forms ¶°¦Xª«¥óªº¨Ï¥Î | ¦Ñ©Ç | 1998/9/21 |
ÀÉ®× I/O | ¤¤¤å¤å¦rÀɪº¶}±Ò¼Ò¦¡ | ¡@ | ¦Ñ©Ç | 1998/9/21 |
¸Ë¸mÅX°Ê | °»´úºÏºÐ¾÷¬O§_¤wready | ¡@ | ¦Ñ©Ç | 1998/9/25 |
ÅܼƳB²z | ¦b Call & BeCall ¤¤¶Ç»¼°}¦C | ¦³¨D¥²À³ªº Variant «¬ºAÅÜ¼Æ | ¦Ñ©Ç | 1998/9/24 |
¼ÆȳB²z | ¦p¦ó±N¶Ã¼Æ²£¥Í¦b©T©w¼ÆȤ§¶¡ | ¡@ | ¦Ñ©Ç | 1998/10/1 |
¼ÆȳB²z | ¤E¤E¼ªkªí | Âù¼h°j°é½d¨Ò | ¦Ñ©Ç | 1998/10/7 |
¼ÆȳB²z | ¥|±Ë¤¤J¨ç¼Æ | ¥Î Format ¨ç¼Æ¥|±Ë¤¤J | ¦Ñ©Ç | 1998/10/8 |
¿é¤JÀˬd | Â÷¶}¿é¤J²°§YÀˬd¿é¤J¬O§_¥¿½T | LostFocus ¨Æ¥ó | ¦Ñ©Ç | 1998/10/2 |
¨Ï¥ÎªÌ¬É± | ÅýµL®Ø½uªí³æ¤£¾B¦í TaskBar | SysInfo Control ªº¨Ï¥Î | ¦Ñ©Ç | 1998/10/3 |
¨Ï¥ÎªÌ¬É± | ·Æ¹«´å¼Ð±m¦âÅÜ¶Â¥Õ | CUR ©M ICO ¹ÏÀɮ榡 | ¦Ñ©Ç | 1998/10/5 |
¨Ï¥ÎªÌ¬É± | ¥Î¤å¦rÀÉÀx¦sµ{¦¡³]©w | ©ß¶} Windows µn¿ý | ¦Ñ©Ç | 1998/10/18 |
¨Ï¥ÎªÌ¬É± | ¥Î·Æ¹«©ì¦²¹Ï¤ù | ¥H MouseMove ¥N´À Drag | ¦Ñ©Ç | 1998/10/27 |
FileBox¨Ï¥Î | ©ì¦²½Æ»s¦hÓÀÉ®×½d¨Ò | ¡@ | ¦Ñ©Ç | 1998/10/8 |
TextBox¨Ï¥Î | Åý TextBox ¤£Åܦ⪺ Unabled | ¡@ | ¦Ñ©Ç | 1998/10/8 |
ScrollBar¨Ï¥Î | ¥Î ScrollBar ±²°Ê Label | ¡@ | ¦Ñ©Ç | 1998/10/10 |
PictureBox¨Ï¥Î | ±×¦Vº¥¼hªº»s§@ | PictureBox.Line ¤èªk | ¦Ñ©Ç | 1998/10/26 |
¦r¦ê³B²z | ¾ã¼Æ¸ÉªÅ¥Õ¡A¤p¼Æ¸É¹s¡C | Format ¨ç¼Æªº¨Ï¥Î | ¦Ñ©Ç | 1998/10/8 |
Cheng Tom ¼¶¼g©ó¤å³¹
¦³¤°»ò¤èªk¥i¥H°»´ú¥Xµ{¦¡³´¤J¤FµL GOTO ?
¦Ñ©Çµª¡G
Dim ¼ÆÈÀˬd As Integer
Private Sub ³Q©I¥s°Æµ{§Ç()
Debug.Print ¼ÆÈÀˬd
¼ÆÈÀˬd=¼ÆÈÀˬd+1
°õ¦æµ{¦¡
Call ¨ä¥L°Æµ{§Ç
¼ÆÈÀˬd=¼ÆÈÀˬd-1
End Sub
- ì²z¬O°Æµ{§Ç¦pªG¦A Call ¨ä¥L°Æµ{§Ç¡A¦¹¦A Call °Ê§@¦pªG¦³ªð¦^¡A«h·|°õ¦æ [¼ÆÈ
Àˬd=¼ÆÈÀˬd-1]¡C- ¦pªG¤@¥h¤£¦^¡A«h [¼ÆÈÀˬd=¼ÆÈÀˬd-1] ´N°õ¦æ¤£¨ì(ª`·N¡A¦p
ªGµ{§Ç¤¤¦³ Exit Sub or Function «ü¥O¡An§â ¼ÆÈÀˬd=¼ÆÈÀˬd-1 ±Æ¦b Exit °Ê§@¤§«e¡C)¡A¼ÆÈÀˬd´N·|¤@ª½²Ö¥[¤U¥h¡C- ©Ò¥H§ÚÌÆ[¹î Debug Window ¡A¼ÆÈÀˬd¤@ª½©¹¤W¥[¡Aªí¥Ü¤K¦¨¶i¤FµL½a°j°é¤¤¡AY®É¤W®É¤Uªº¡AÀ³¸Ó¬OÁÙ¨S°õ¦æ§¹²¦¡A§A¸Õ¸ÕWork ¤£ Work ¡A¦]¬°§Ú¤]¨S§â´¤¡C³oÓÃD¥ØÀ³¸ÓÁÙ¦³¨ä¥L§@ªk¡A§Æ±æ¤j®a¶°«ä¼s¸q¤@¤U¡C
§Ú¨ÌµM¬O¤p§b¥Ê ¼¶¼g©ó¤å³¹
n¦p¦ó²³æ±oª¾¤@ÓGetFocusªº¤lµøµ¡¥¦ªºForms(I)¤¤ I ªº¼ÆÈ
¦Ñ©Çµª¡G
Private Sub Command1_Click()
Dim I As Integer
Dim FormIndex As Integer
For I = 0 To Forms.Count - 1
If Forms(I) Is Me.ActiveForm Then
FormIndex = I
Exit For
End If
Next
Debug.Print FormIndex
End Sub
(¤@¥b) ªº¤å³¹¤¤´£¨ì:
VBªºSUB¥i¥H¶Ç»¼°}¦C¶Ü?¬Ý¤F½u¤W¤â¥U¨S¬Ý¨ì½d¨Ò,¬O§_¯uªº¤£¦æ¶Ü?
¦Ñ©Çµª¡G
³Á§J¤E³J ¼¶¼g©ó¤å³¹
´N¬O¦bµ{¦¡¤¤§Ú·Q¹³ getch()ªºfunction «ö¥ô·NÁä¦AÄ~Äò¤U¤@¨B§Ú·QÀ³¸Ó¦³§a,¦³¨S¤Hª¾¹D©O?
¦Ñ©Çµª¡G
¦Û¤v¼g¼ÒÀÀµ{¦¡Åo
Option Explicit
Dim EndLoop As Boolean
Private Sub Form_Click()
GetC
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii <> 0 Then
EndLoop = True
End If
Label1.Caption = "LoopIsEnd"
End Sub
Private Sub GetC()
Do
If EndLoop Then
Exit Do
End If
Label1.Caption = Now
DoEvents
Loop
EndLoop = False
End Sub
³Á§J¤E³J ¼¶¼g©ó¤å³¹
½Ð°ÝVB5¦p¦ó±oª¾ºÏºÐ¾÷¬O§_¤wready??
¦Ñ©Çµª¡G
Private Sub Command1_Click()
Dim OldPath As String
On Error Resume Next
OldPath = CurDir
ChDrive "a:"
Select Case Err.Number
Case 68
MsgBox Err.Description, vbOKOnly, "¿ù»~¥N½X¡G" & Err.Number
End Select
ChDrive OldPath
End Sub
±H¥óªÌ: ÂŦâ®È¤H
¦Ñ©Çµª¡G
Option Explicit
Private Sub Form_Click()
Dim I As Integer
'©I¥s©T©w½d³ò¶Ã¼Æ¦Û©w¨ç¼Æ
Debug.print GetRangeRnd(12, 11)
End Sub
Private Function GetRangeRnd(ByVal Max As Integer, _
Optional ByVal Min As Integer) As Integer
Dim TempNum As Integer
'¦pªG¨Ï¥ÎªÌ§â¶Ç¤J°Ñ¼Æªº³Ì¤pȳ]ªº¤ñ³Ì¤jȤj¡A
'¨º»ò¤j¤pȤ¬´«
If Min > Max Then
TempNum = Max
Max = Min
Min = TempNum
End If
'±Ò°Ê¶Ã¼ÆºØ¤l
Randomize
TempNum = Int((Max - Min + 1) * Rnd) + Min
GetRangeRnd = TempNum
End Function
²Â²Âªº®a½Þ ¼¶¼g©ó¤å³¹
§Ú·Q·í§Úªº Focus ¤@Â÷¶} TextBoxªº®ÉÔ´N¥i¥HÅã¥Ü¥¼¶ñ¼g¸ê®Æªº°T®§,³on¦p¦ó¥hÀ³¥Î???
¦Ñ©Çµª¡G
Private Sub Text1_LostFocus()
Dim GoBack As Integer
If Len(Text1.Text) <> 8 Then
GoBack = MsgBox("§A¸ê®Æ¿é¤J¤£§¹¾ã¡A¬O§_«·s¿é¤J¡H",
vbYesNo, "¸ê®Æ¤í¯Ê")
If GoBack = vbYes Then
Text1.SetFocus
End If
End If
End Sub
YIhan ¼¶¼g©ó¤å³¹
½Ð°Ý Form ¦p¦ó³]©wÅý¥¦¤W¤èµL"¤j¤p½Õ¾ã"(title)¡A¦Ó¤U¤è«O¯d95ªº¤u§@¦C¡A¬°¦ó§Ú³£³]¤£¥X¨Ó?
¦Ñ©Çµª¡G
§Ö¨ú ¼¶¼g©ó¤å³¹
¥ÎVB ¼g¤@µ{¦¡,¨Ï¥Î¦Ûq¤§MOUSE ICON,¨ä ´å¼Ð¬°±m¦â,,,¦ý µ{¦¡¦bRUN®É,¹C¼Ð«oÅܦ¨¤F¶Â¥Õªº....WHY ???
¦Ñ©Çµª¡G
¹çY ¼¶¼g©ó¤å³¹
¦U¦ìºô¤Í.....§Ú¬O¤@ÓVB5.0ªºªì¾ÇªÌ.....¦Ñ®v¥X¤F¤@ÓÃøÃD.....¨º´N¬On¥Î±_ª¬°j°é¼g¤@Ó¤E¤E¼ªkªíªºµ{¦¡......¦Ó§Ú¤Sè¾ÇVB5.0.....¹ê¦b¬O¤£¤Ó·|¼g.....©Ò¥H·Q½Ð¦U¦ì¦n¤ßªººô¤ÍÌÀ°À°§Ú.....·P¿E¤£ºÉ.....
¦Ñ©Çµª¡G
±H¥óªÌ: 78go
½Ð°Ý.... vb¥i¥H°µ¦¨¹³cview¤@¼Ëªº¤u¯à¶Ü??? (´N¬O¥i¥H¿ï¨ú¦hÓ¸ê®Æ«á¦A±N¥¦¦s¤J¨ä¥L¦a¤è...¦pdisk,©Î¸ê®Æ®w¤º) ½Ð´£¨Ñ½d¨Ò....·N¨£.....thanks
¦Ñ©Çµª¡G
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5475
ClientLeft = 60
ClientTop = 345
ClientWidth = 6510
LinkTopic = "Form1"
ScaleHeight = 5475
ScaleWidth = 6510
StartUpPosition = 3 '¨t²Î¹w³]È
Begin VB.Frame Frame2
Caption = "¥Ø¼Ð°Ï"
Height = 4935
Left = 3360
TabIndex = 4
Top = 120
Width = 3015
Begin VB.DriveListBox Drive2
Height = 300
Left = 360
TabIndex = 7
Top = 360
Width = 2295
End
Begin VB.DirListBox Dir2
Height = 1140
Left = 360
TabIndex = 6
Top = 840
Width = 2295
End
Begin VB.FileListBox File2
DragIcon = "Form1.frx":0000
Height = 2250
Left = 360
MultiSelect = 2 '¶i¶¥¦h«¿ï¨ú
TabIndex = 5
Top = 2280
Width = 2295
End
End
Begin VB.Frame Frame1
Caption = "¨Ó·½°Ï"
Height = 4935
Left = 120
TabIndex = 0
Top = 120
Width = 3015
Begin VB.FileListBox File1
DragIcon = "Form1.frx":030A
Height = 2250
Left = 360
MultiSelect = 2 '¶i¶¥¦h«¿ï¨ú
TabIndex = 3
Top = 2280
Width = 2295
End
Begin VB.DirListBox Dir1
Height = 1140
Left = 360
TabIndex = 2
Top = 840
Width = 2295
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 360
TabIndex = 1
Top = 360
Width = 2295
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'½Ð¤£n§Ñ¤F¡A¨Ó·½Àɮײ°¦b³]p¶¥¬q MultiSelect Äݩʤ@©wn³]¬° True
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Dir2_Change()
File2.Path = Dir2.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Drive2_Change()
Dir2.Path = Drive2.Drive
End Sub
Private Sub File1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'«ö·Æ¹«¥kÁäªí¥Ü©ì¦²¶}©l
If Button = 2 Then
File1.Drag 1
End If
End Sub
Private Sub File2_DragDrop(Source As Control, X As Single, Y As Single)
Dim I As Integer
'¦pªG©ì¦²¨Ó·½¬OÀɮײ°
If TypeName(Source) = "FileListBox" Then
For I = 0 To Source.ListCount - 1
'¦pªGÀɮ׳Q¿ï¨ú
If Source.Selected(I) Then
FileCopy Source.Path & "\" & Source.List(I), _
File2.Path & "\" & Source.List(I)
End If
Next
'¥Ø¼ÐÀɮײ°§ó·sÅã¥Ü
File2.Refresh
'¨Ó·½Àɮײ°µ²§ô©ì¦²°Ê§@
Source.Drag 2
End If
End Sub
jsc72232 ¼¶¼g©ó¤å³¹
½Ð°Ý Format ¨ç¼Æn«ç¼Ë³]©w¤~¯à¤£½×¼ÆȤj¤p¡A³£¦³©T©wªø«×¡A¨Ã¥B¾ã¼ÆY¤£¨¬ªø«×«h¥HªÅ¦ì¤¸¶ñ¤J¡A¤p¼Æ³¡¥÷«h¥H "0" ¦r¤¸¸É¤J¡C
¦Ñ©Çµª¡G
'¸Õ¸Õ¬Ý¤U±³o¬q
Option Explicit
Private Sub Command1_Click()
'³]©w¾ã¼Æ¤E¦ì¡A¤p¼Æ¨â¦ì¡A¤p¼Æ¤£¨¬¸É¹s¡A¾ã¼Æ¤£¨¬¸ÉªÅ¥Õªº®æ¦¡¡C
Text1.Text = Right(Space(11) & Format(5459.4, "###,###,###.00"), 14)
End Sub
Private Sub Form_Load()
'Courier New ¦r«¬¬O¨CÓ¦r¤j¤p³£¤@¼Ë¡A
'¥i¥H§K¥h^¤å¦r¼e¯¶¤£¤@ªº¹ï»ô§xÃø¡C
Text1.FontName = "Courier New"
End Sub
XXX ¼¶¼g©ó¤å³¹
VB¦³µL²{¦¨ªº¥|±Ë¤¤J¨ú¾ã¼Æªº¨ç¼Æ¥i¥Î?
¦Ñ©Çµª¡G
Â÷»î ¼¶¼g©ó¤å³¹
¦bvb¤¤¦p¦ó¨Ï textbox ¤£¯à¿é¤J¸ê®Æ¡A¦ý¤S¤£·Q¨Ï±o¤å¦r®Øªº¦rÅܦ¨¦Ç¥Õ¦â¦Ó¨Ï¥Î enabled ÄÝ©Ê¡A¤£ª¾¬O§_ÁÙ¦³¨ä¥Lªº¤èªk¥i¥H¥Î©O???
¦Ñ©Çµª¡G
³q°T®a ¼¶¼g©ó¤å³¹ ...
½Ð°Ý¸Ó¦p¦ó¨Ï¥ÎVBªºVScrollBAR¥h³sµ²¥²¶·Åã¥Ü«Ü¦h¦rªºLabel,¨Ï¨ä¥i¥H¨Ï¥ÎVScrollBAR½¶©O??
¦Ñ©Çµª¡G
Option Explicit
'¨ä¹ê¥Î Vscroll ±²°Ê Label ¡A©M¥Î Timer ±² Label ¬O¤@¼Ëªºì²z¡A
'©Ò¥H¦¹³B§Ú§â Label ±²°Ê²°»P¹q¤l±²°Ê¬ÝªO¦X¦Ó¬°¤@¡A½Ð¤j®a«Øij§åµû¡C
'¥»½d¨Ò¶·¥Î Label1,Vscroll1,Command1,Picture1,Timer1
Private Sub Command1_Click()
If Command1.Caption = "¶}©l¹q¤l§G§iÄæ" Then
Command1.Caption = "µ²§ô¹q¤l§G§iÄæ"
'¥´¶}¦Û°Ê±²°ÊÅX°Ê¾¹
Timer1.Enabled = True
Else
Command1.Caption = "¶}©l¹q¤l§G§iÄæ"
'Ãö¤W¦Û°Ê±²°ÊÅX°Ê¾¹
Timer1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Dim Loadstring As String
Dim BuffString As String
Dim FileHandle As Integer
'§â Label ³]¦¨³z©ú¤~¥i¥H¬Ý¨ì Picture1 I´º
Label1.BackStyle = 0
With Picture1
'³æ¦ì³]¬°¹Ï¯À¥iÁקK Label °ª«×¶W¹L Scroll ¤ä´©¤W
.ScaleMode = 3
'§â Vscroll Align Picture Right
VScroll1.Move .ScaleWidth - VScroll1.Width, _
.ScaleTop, VScroll1.Width, .ScaleHeight
'³Ñ¤UªºªÅ¶¡µ¹ Label ¨ÓÅã¥Ü
Label1.Width = .ScaleWidth - VScroll1.Width
Label1.Move .ScaleLeft, .ScaleTop
End With
'¶}±Ò¤å¦rÀɮסA¨Ã©ñ¤J Label ¤¤
FileHandle = FreeFile
Open "c:\temp\vtcolor.htm" For Input As #FileHandle
Do While Not EOF(FileHandle)
Line Input #FileHandle, Loadstring
BuffString = BuffString + Loadstring + vbCrLf
Loop
Close #FileHandle
Label1.Caption = BuffString
'¥b¬íÄÁ±²¤@¦¸
Timer1.Interval = 500
'¥ý§âÅX°Ê¾¹ÃöµÛ¡C
Timer1.Enabled = False
Command1.Caption = "¶}©l¹q¤l§G§iÄæ"
'±Ò°Ê¶Ã¼ÆºØ¤l¡Aµ¥¤U¿ï¨ú¶Ã¼Æ¦â±m·|¥Î¨ì¡C
Randomize
End Sub
'¦]¬° Label1.Autosize ©M Label.WordWrap ÄÝ©Ê·f°t¥X¨Óªº¤j¤p¤£¯àºë½T¹ï»ô¡A
'¦]¦¹§Ú̦ۦæ¨Ì Label.Caption ¤º®e½Õ¾ã°ª«×
Private Sub Label1_Change()
Label1.Height = Picture1.TextHeight(Label1.Caption)
'VScorll ³Ì¤jȬ° Label °ª«×
VScroll1.Max = Picture1.TextHeight(Label1.Caption)
'VScorll ±²°ÊȬ° Label ¦r¤¸°ª«×
VScroll1.SmallChange = Label1.FontSize
'VScorll ½¶È¬° Picture1 °ª«×
VScroll1.LargeChange = Picture1.ScaleHeight
End Sub
Private Sub Timer1_Timer()
If VScroll1.Value + Label1.FontSize <= VScroll1.Max Then
'Label ¦V¤U©Ô¤@¶
VScroll1.Value = VScroll1.Value + VScroll1.SmallChange
Else
'Label ±qÀYÅã¥Ü
VScroll1.Value = 0
End If
End Sub
Private Sub VScroll1_Change()
Dim RndNum As Byte
'Label °t¦X Vsrcoll ȱ²°Ê
Label1.Move Picture1.ScaleLeft, Picture1.ScaleTop - VScroll1.Value
'¥H¤U¯Â¬°ÄÌ¥]³]p¡A¤£³ßÅw´N®³±¼
'¨ú 0~15 ªº¤@ӶüÆ
RndNum = Int(Rnd * 16)
'¨ú QuickBasic Color ¤Q¤»¦â©w¸q¤§¤@¦â
Picture1.BackColor = QBColor(RndNum)
'Label ¬° Picture ªº¤Ï¬Û¦â
Label1.ForeColor = QBColor(15 - RndNum)
End Sub
±H¥óªÌ: ½²¤å¤s (m2664)
µ{¦¡»Ýn¦³¨âÓ°j°é¦P®É¹Bºâ¡A¦P®É°õ¦æ¡A¤£ª¾¹D¦³¦óºØ¿ìªk¥i¥H¨ì¦h¤uªº¥Øªº¡H
¦Ñ©Çµª¡G
n½Í°_ Windows µ{¦¡¦h¤u°ÝÃD¡A³o°ÝÃD¤S½ÆÂø¤F¡A¤£½Í²z½×¡A¥u½Í§Ú¥Î¹Lªº¥i¦æ¿ìªk¡G
±H¥óªÌ: ²³ì«F
¦p¦ó±N¤@µ{¦¡¤¤ªº¤@¤Á³]©wÈ(¦pªG¤£¤Öªº¸Ü),Àx¦s¦b¤@°¦¯Â¤å¦rÀɤ¤,§Ú¥u§Æ±æ¯à°÷¦s¦b¯Â¤å¦rÀɤ¤!!¨Ã¥B¤@Ó³]©wȤ@¦æ¡C
¦Ñ©Çµª¡G
±H¥óªÌ: wopeter
§Ú·Q°ÝÃö©ó±×¦Vº¥¼hªº¼gªk
¦Ñ©Çµª¡G
Option Explicit
'°µ±×¨¤½u©Êº¥¼h¯u¥¿ªº³~®|À³¸Ó¬O±Ò¥Î¤T¨¤¨ç¼Æ¡A¨Ì§¨¨¤©·«×ºâ¥X
'¹ï¨¤ÂI¦ì¸m¡A¦ý¦]¥»¤H°ª¤¤®É¥N«Ü¥´²V¡A¤T¨¤¨ç¼Æ±q¨Ó¨SÀ´¹L¡A©Ò
'¥H¥u·|°µ 45 «×¨¤±×½uº¥¼h¡C©Ò©¯¥~±Ã¸¹Ï³nÅ骺±×¨¤½u©Êº¥¼h¤]
'³£¬O 45 «×¡A©Ò¥H¦Ñ©Ç¤]¤£ºâ¤Ó¥áÁy¡C
'45 «×¨¤½u¦³Ó«Ü Easy ªº¯S©Ê¡A´N¬O§¨ª½¨¤ªº¨âÃäµ¥ªø¡A©Ò¥H¨D
'(x,y) ªº¥ª¹ï¨¤ÂI´N¬O (x-ScaleHeight,y+ScaleHeight)¡A
'(x,y) ªº¥k¹ï¨¤ÂI´N¬O (x+ScaleHeight,y+ScaleHeight)¡A
'©Î³\¦³¤Hn°Ý¨º x-ScaleHeight<0 ©Î x+ScaleHeight>ScaleWidth
'«ç»ò¿ì¡Hµª®×¬O¨S«ç»ò¿ì¡A§A´NÅý¥¦µe¥X¥h¡A¤Ï¥¿·|Åã¥Ü¥X¨Óªº¥u
'¦³¨ºÓÅã¥Ü®Ø¦Ó¤w¡A§AºÞ¨º±ø½u¬Oµe¨ì¤ÑÃäÁÙ¬O®ü¨¤¡H©Ò¥HÆZ·F¤@
'µf¡A¦Ñ©Çªº½u©Êº¥¼h²°´N°µ¥X¨Ó°Õ¡C
'´ú¸Õ¥»½d¨Ò½Ð¦b Form ¤W¥¬¸m Picture1,Frame1,Label1,Text1¡A¨Ã
'¦b Frame1 ®Ø¬[¤º©ñ¤J Option1(0),Option1(1),Option1(2),Option1(3)
'½u±ø¼e«×³]©w
Dim LineWidth As Byte
'½u±ø°_ÂIªº X ®y¼Ð
Dim UpStart As Long
'½u±ø²×ÂIªº X ®y¼Ð
Dim DnStart As Long
'¦â±mºÝÂI¿ï¾Ü
Dim ColorStart As Integer
Private Sub Form_Load()
Frame1.Caption = "¥ú·½¤è¦V¿ï¾Ü"
Option1(0).Caption = "¥ú·½¥ª¤W"
Option1(1).Caption = "¥ú·½¥ª¤U"
Option1(2).Caption = "¥ú·½¥k¤W"
Option1(3).Caption = "¥ú·½¥k¤U"
Me.Caption = "±×¨¤½u©Êº¥¼h½d¨Ò"
Label1.Caption = "½u±ø¼e«×"
'³]©w½u±ø¼e«×¬° 8 Pixels
'½u±ø¼e«×·U²Ó¡Aµe±·U²Ó½o¡A¦ýÅã¥Ü¤]·U¶O®É¡C
Text1.Text = 8
With Picture1
'Picture ³æ¦ì¬° Pixel
.ScaleMode = 3
'³]©w Picture µe½u¼e«×
.DrawWidth = LineWidth
End With
'¹w³]¥ú·½¬°¥ª¤W
Option1(0).Value = True
End Sub
Private Sub Option1_Click(Index As Integer)
With Picture1
Select Case Index
Case 0
'¥H Picture ¥ªºÝ¬°½u°_ÂI X ¶b
UpStart = 0
'½u²×ÂI X ¶b¦V Picture ¥ªºÝ²¾¥X¤@Ó Picture °ª«×¶ZÂ÷
DnStart = -.ScaleHeight
'¥H 255 ¬°¦â±m°_ÂI
ColorStart = 255
Case 1
'½u°_ÂI X ¶b¦V Picture ¥ªºÝ²¾¥X¤@Ó Picture °ª«×¶ZÂ÷
UpStart = -.ScaleHeight
'¥H Picture ¥ªºÝ¬°½u²×ÂI X ¶b
DnStart = 0
ColorStart = 255
Case 2
UpStart = -.ScaleHeight
DnStart = 0
'¥H 0 ¬°¦â±m°_ÂI
ColorStart = 0
Case 3
UpStart = 0
DnStart = -.ScaleHeight
ColorStart = 0
End Select
End With
'PictureBox «Ã¸
Picture1_Paint
End Sub
Private Sub Picture1_Paint()
Dim I As Long, Total As Long
Dim Trans256 As Integer
'¥þ³¡Ã¸¹Ï¦¸¼Æ¬° Picture ¼e«×¥[°ª«×
Total = Picture1.ScaleWidth + Picture1.ScaleHeight
'¨Ì½u±ø¼e«×¦Ó¨M©w¹j´XÂIµe¤@±ø½u
For I = 0 To Total Step LineWidth
'§â 256 ¶¥¦â±m±j«×¥§¡¤À°tµ¹Á`ªø«×¡A¥H§Q¶¥¼hÅã²{
Trans256 = (255 / Total) * I
'Abs(UpStart+DnStart)=Picture1.ScaleHeight,¤§©Ò¥H
'¤£¥Î ScaleHeight ¬OÁקK¨C¦¸¬d®Ö ScaleHeight ©ì©µ
'³B²z³t«×
Picture1.Line (I + UpStart, 0)-(I + DnStart, _
Abs(UpStart + DnStart)), _
RGB(Abs(ColorStart - Trans256), Abs(ColorStart - Trans256),
0)
Next
End Sub
Private Sub Text1_Change()
If Val(Text1.Text) > 255 Then Text1.Text = 255
If Val(Text1.Text) <= 0 Then Text1.Text = 1
LineWidth = Val(Text1.Text)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
'KeyAscii 32 ¥H¤U¬O¤@¨Ç±±¨îÁä¡AÄdºI·|³y¦¨¾Þ§@»Ùê
If KeyAscii >= 33 Then
If KeyAscii <= vbKey9 And KeyAscii >= vbKey0 Then
Else
'§â KeyAscii ³]¬° 0 ´N¬O¨ú®ø¿é¤J
KeyAscii = 0
MsgBox "¤£¥i¿é¤J«D¼Æ¦r¦r¤¸"
End If
End If
End Sub
±H¥óªÌ: ssman
½Ð°Ý¡A§Ú·Q§â¤@¹Ï¤ù©ì¦²¨ì¥tªÅ¥Õ¹Ï§Î¤è¶ô¡A¦p¦ó¦b©ì¦²¹Ï¤ù®ÉÅã¥Ü¸Ó¹Ï¤ù¨Ã§â¥¦©ñ¨ì¸ÓªÅ¥Õ¹Ï§Î¤è¶ô¡C
¦Ñ©Çµª¡G