¤ÀÃþ |
¼ÐÃD |
¤j·N |
§@ªÌ |
¤é´Á |
¤¸¥ó¨Ï¥Î | ²©ö¤ë¾ä½d¨Ò | Label °}¦CªºÅܤƹB¥Î | ¦Ñ©Ç | 1998/8/13 |
ª«¥ó¨Ï¥Î | §R°£¦C¦L¤å¥ó | Printer.KillDoc ªº¤èªk | ¦Ñ©Ç | 1998/8/18 |
ª«¥ó¨Ï¥Î | ¥Î Collection ª«¥ó±Ò°Êªí³æ | ¥Î¦r¦ê Load Form | ¦Ñ©Ç | 1998/8/18 |
ª«¥ó¨Ï¥Î | ²©öÅwªïµe± | Logo Form | ¦Ñ©Ç | 1998/8/18 |
¹Ï§Î³B²z | ¦p¦ó Paint ¥X³z©úI´º¹Ï | RasterOp ±`¼Æªº¨Ï¥Î | ¦Ñ©Ç | 1998/8/13 |
ÅܼƳB²z | °Æµ{¦¡»P°ïÅ| | ¡@ | CWW | 1998/8/13 |
ÅܼƳB²z | ÅܼÆÈ¿ò¥¢ | IsMissing() ¨ç¼Æªº¥Î³~ | ¦Ñ©Ç | 1998/8/13 |
ÅܼƳB²z | ¦Ûq«¬ºAÅܼƳsÀô®M | ¦h¼h¦Ûq«¬ºAÅÜ¼Æ | ¦Ñ©Ç | 1998/8/20 |
µ{¦¡©I¥s | ÁקKµ{¦¡¦h¦¸°õ¦æ | App.PrevInstance ªº¥Î³~ | daisy | 1998/8/13 |
¦r¦ê³B²z | Åý´å¼Ð¦b TextBox ³Ì«á¤@¦æ | ·í TextBox ¤º®e§ïÅÜ®É | ¦Ñ©Ç | 1998/8/13 |
¦r¦ê³B²z | §â¦r¦ê©î¦¨°}¦C | Len() & Mid() | ¦Ñ©Ç | 1998/8/15 |
¦r¦ê³B²z | ¦b TextBox ùØ Format | Text_Change & Format() | ¦Ñ©Ç | 1998/8/15 |
Àɮ׳B²z | ¸ê®Æ§¨ªº½Æ»s | FileCopy & MkDir | ¦Ñ©Ç | 1998/8/14 |
ÀÉ®×I/O | ³v¦æ¼g¤J¦r¦ê | Print # ³¯zªº¨Ï¥Î | ¦Ñ©Ç | 1998/8/16 |
ÀÉ®×I/O | VB ªºÀɮצs¨ú¼Ò¦¡ | ¤£¦P®ÄªGªºÀɮצs¨ú | ¦Ñ©Ç | 1998/8/16 |
¬É±¥~Æ[ | »Pµøµ¡³s°Êªº Control | Form_Resize ªº§Q¥Î | ¦Ñ©Ç | 1998/8/15 |
±`¼Æ«Å§i | ¦b§Aªºµ{¦¡ùثŧi PI È | ¡@ | Kevin | 1998/8/4 |
¿ù»~³B²z | ª¾¿ù¤ñ¤£¿ù¦n | Err ª«¥óªº¨Ï¥Î | ¦Ñ©Ç | 1998/8/22 |
¿ù»~³B²z | ±N¿ù´N¿ù | Resume Next ªº§®¥Î | ¦Ñ©Ç | 1998/8/22 |
µ{¦¡²z©À | §Y®É¾Ô²¤¹CÀ¸ªºì²z | Timer ªº¨Ï¥Î | ¦Ñ©Ç | 1998/8/17 |
'------------ Cut Here ----------------
VERSION 5.00
Begin VB.Form Form1
Caption
= "²©ö¤ë¾ä"
ClientHeight = 3945
ClientLeft =
4200
ClientTop =
2985
ClientWidth =
3885
LinkTopic =
"Form1"
ScaleHeight =
3945
ScaleWidth =
3885
Begin VB.CommandButton cmdShow
Caption
= "½T©wÅã¥Ü"
BeginProperty Font
Name
= "·s²Ó©úÅé"
Size
= 9
Charset
= 136
Weight
= 700
Underline
= 0 'False
Italic
= 0 'False
Strikethrough
= 0 'False
EndProperty
Height
= 495
Left
= 2520
TabIndex
= 5
Top
= 360
Width
= 1095
End
Begin VB.TextBox txtMonthBox
Height
= 270
Left
= 1440
TabIndex
= 4
Text
= "Text1"
Top
= 600
Width
= 735
End
Begin VB.TextBox txtYearBox
Height
= 270
Left
= 1440
TabIndex
= 3
Text
= "Text1"
Top
= 240
Width
= 735
End
Begin VB.Label lblMonthTitle
Caption
= "½Ð¿é¤J¤ë¥÷"
Height
= 255
Left
= 240
TabIndex
= 2
Top
= 600
Width
= 975
End
Begin VB.Label lblYearTitile
Caption
= "½Ð¿é¤J¦~¥÷"
Height
= 255
Left
= 240
TabIndex
= 1
Top
= 240
Width
= 975
End
Begin VB.Label lblDay
Caption
= "Label2"
Height
= 495
Index
= 1
Left
= 840
TabIndex
= 0
Top
= 2160
Width
= 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdShow_Click()
If Not IsNumeric(txtYearBox.Text) Then GoTo
DateWrong
If Val(txtYearBox.Text) < 0 Or Val(txtYearBox.Text)
> 9999 Then GoTo
DateWrong
If Not IsNumeric(txtMonthBox.Text) Then GoTo
DateWrong
If Val(txtMonthBox.Text) < 1 Or Val(txtMonthBox.Text)
> 12 Then GoTo
DateWrong
'°õ¦æ¶ñ¤J¤é´Á°Æµ{¦¡
PutDay Val(txtYearBox.Text), Val(txtMonthBox.Text)
Exit Sub
DateWrong:
MsgBox "§A¤é´Á®æ¦¡¿é¤J¿ù»~",
vbOKOnly, "¤é´Á¿ù»~"
'¦b¤å¦r®Ø¶ñ¤W¤µ¤Ñªº¦~¥÷
txtYearBox.Text = Year(Date)
'¦b¤å¦r®Ø¶ñ¤W¤µ¤Ñªº¤ë¥÷
txtMonthBox.Text = Month(Date)
'°õ¦æ¶ñ¤J¤é´Á°Æµ{¦¡
PutDay Val(txtYearBox.Text), Val(txtMonthBox.Text)
End Sub
Private Sub Form_Load()
Dim I As Integer
Dim XPos As Single, YPos As Single
Dim ColorChoice As Integer
'³]©w¤é´Á¼ÐÅҮ榡
With lblDay(1)
.Alignment = 2
.BackColor = RGB(255,
255, 255)
.BorderStyle = 1
.FontSize = 12
.FontBold = True
.Width = 495
.Height = 375
.Caption =
""
End With
'³]©w²Ä¤@Ó¤é´Á¼ÐÅÒ¦ì¸m
XPos = 240
YPos = 1080
lblDay(1).Move XPos, YPos
XPos = XPos + lblDay(1).Width
'¸ü¤J¨ä¾l¼ÐÅÒ¡A¨Ã³]©wÅã¥Ü¦ì¸m
For I = 2 To 49
Load lblDay(I)
lblDay(I).Move XPos,
YPos
lblDay(I).Visible =
True
XPos = XPos + lblDay(1).Width
If I Mod 7 = 0 Then
XPos = 240
YPos = YPos + lblDay(1).Height
End If
Next
'³]©w¬P´ÁÅã¥ÜÃC¦â
For I = 1 To 49
ColorChoice = I Mod 7
Select Case
ColorChoice
Case 0
lblDay(I).ForeColor = RGB(0, 255, 0)
Case 1
lblDay(I).ForeColor = RGB(255, 0, 0)
Case Else
lblDay(I).ForeColor = RGB(0, 0, 255)
End Select
Next
'Åã¥Ü¤é´Á¼ÐÃD
lblDay(1).Caption = "¤é"
lblDay(2).Caption = "¤@"
lblDay(3).Caption = "¤G"
lblDay(4).Caption = "¤T"
lblDay(5).Caption = "¥|"
lblDay(6).Caption = "¤"
lblDay(7).Caption = "¤»"
'¦b¤å¦r®Ø¶ñ¤W¤µ¤Ñªº¦~¥÷
txtYearBox.Text = Year(Date)
'¦b¤å¦r®Ø¶ñ¤W¤µ¤Ñªº¤ë¥÷
txtMonthBox.Text = Month(Date)
'°õ¦æ¶ñ¤J¤é´Á°Æµ{¦¡
PutDay Val(txtYearBox.Text), Val(txtMonthBox.Text)
End Sub
Private Sub PutDay(ByVal YearValue As Integer, _
ByVal MonthValue As
Integer)
Dim LastDay As Integer, FirstWeekDay As Integer
Dim I As Integer
'pºâ¨C¤ë³Ì«áªº¤@¤Ñ¬O´X¸¹
LastDay = Day(DateSerial(YearValue, MonthValue
+ 1, 0))
'pºâ¨C¤ëªº²Ä¤@¤Ñ¬O¬P´Á´X
FirstWeekDay = WeekDay(DateSerial(YearValue,
MonthValue, 1), 0)
'²M±¼¤W¤@¦¸ªºÅã¥Ü
For I = 8 To 49
lblDay(I).Caption =
""
Next
'I ±q 7 ¶}©lªí¥ÜÁ׶}¬P´Á¼ÐÃD¼ÐÅÒ
For I = 7 To LastDay + 6
lblDay(I +
FirstWeekDay).Caption = I - 6
Next
End Sub
'------------- End Here ----------------
¬q ÅA ¼¶¼g©ó¤å³¹
¥Î Paintpicture¤èªk¦³Ó°ÝÃD...§Ú쥻§Q¥Îgif¯S©Ê©Ò³y¥X¨Óªº³z©úI´º, ³z©úªº³¡¥÷³£³Q¶ñ¤W¥Õ¦â¤F..½Ð°Ý¦³¨S¦³¤èªk¯à«O«ùì¥ý³z©úªº®ÄªG..
¦Ñ©Çµª¡G
³o¬O¤@ӫܤֳQ½Í°_ªº°ÝÃD¡A¦ý¤£ªí¥Ü¤£«n¡A¦p§A¹ï¥»½gÆ[©À¤´¦³ºÃ°Ý¡A½Ð¦V CWW ½Ð±Ðhttp://sunh.hosp.ncku.edu.tw/~cww/¡C
¦Ñ©Ç©ó 1998/8/11¡G
§Ú¦pªG¥Î¤U¦Cµ{¦¡½X¼ÒÀÀ·Æ¹«³sµo°Ê§@¡A«h«ö¤U·Æ¹«±Ò°Ê°j°é¡A©ñ¶}·Æ¹«´N°±¤î°j°é¡A¤@¤Á¦p§Ú¹w´Á¡G
Dim Working As Boolean
Private Sub ContinueClick()
Dim I As Long
Do While Working
I = I + 1
Label1.Caption = I
DoEvents
Loop
End Sub
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label1.Caption = ""
Working = True
ContinueClick
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Working = False
End Sub
¦ý¦pªG§Ú¥Î¤U¨Ò¡A«h©ñ¶}·Æ¹««á¡A°j°é¤£·|°±¤î¡G
Private Sub ContinueClick(byval Working as boolean)
Dim I As Long
Do While Working
I = I + 1
Label1.Caption = I
DoEvents
Loop
End Sub
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label1.Caption = ""
ContinueClick true
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
ContinueClick False
End Sub
¦ü¥G¦b°j°é¤¤ªºµ{¦¡¡A¦b¥¼µ²§ô«e¸ò¥»¤£²z·|¶Ç¶i¨Óªº°Ñ¼Æ¡A©Î¬O¥t¦³ì¦]¡A½Ðª¾¹Dªº¤H´À§Ú¸Ñ´b¤@¤U¡C
CWW ©ó 1998/8/12¡G
©I¥sContinueClick False®É¡A¥Nªí¥t¥~°_¤@Óstack ¦b°µContinueClickªº¨Æ¡A©Ò¥H¥¦¤@©lworking = false©Ò¥H´Nµ²§ô¤F¡A¦ÓContinueClick Trueªº¨º¤@¬qµ{¦¡½XÁÙ¦b°õ¦æ¡A©Ò¥H¤£·|°±¡A±z¥i¥HDebug¬Ý¤@¬Ý´Nª¾¹D¡A¤¤Â_ÂI¦bContinueClick False¦Ó«á«öF8¡C§_«h¡A½Ð§ï¥Î¥H¤U¤è¦¡´N¥i¥H
Private Sub ContinueClick(ByVal Working As Boolean)
Dim I As Long
Static conti As Boolean
conti = Working
Do While conti
I = I + 1
Label1.Caption = I
DoEvents
Loop
End Sub
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Caption = ""
ContinueClick True
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
ContinueClick False
End Sub
¦Ñ©Ç©ó 1998/8/12
Private Sub ContinueClick(ByVal Working As Boolean)
Dim I As Long
Static conti As Boolean
'¬°¦ó¥[³oÓ´N¥i¥H«¨¡AÁÙ¬O¤£¤ÓÀ´¡C
conti = Working
'........................................
End Sub
CWW©ó 1998/8/13
static ¨Ã¤£¬O©ñ¦b°ïÅ|¤ºªºÅܼơA©Ò¥H¤@¸g³]©w¡A¤£¦ý¼vÅTContinueClick Falseªº¨º¤@¨Sµ{¦¡½X¡A³s¦PContinueClick true©Ò¤Þµoªº¨º¬qµ{¦¡¤]¦]conti = false¦Ó¥O°j°é¤¤¤î¡C
¦Ñ©Çªº²z¸Ñ¡G
(¤p®¦) ªº¤å³¹¤¤´£¨ì:
§Ú¥Î VB ¼g¤F¤@Óµ{¦¡¡In«ç»ò§PÂ_µ{¦¡¤w¸g°õ¦æ¤F©O¡H
daisy¡G
¦bform load ¤¤¥[¤J
If App.PrevInstance = True Then 'ÁקKµ{¦¡¦h¦¸°õ¦æ
End
End If
±H¥óªÌ: ¦ó©Ó¿o
¤°»ò¬O if Not IsMissing() then
¦Ñ©Çµª¡G
IsMissing() ¬OÓÀˬdÅܼƫ¬ºAªº¨ç¼Æ¡A¥¦³Ì²³æªº¸ÑÄÀ´N¬OÅܼƫ¬ºA¿ò¥¢¡A¤]´N¬O¥»¨Ó¥¦¥i¥HÂǥѫü©wªº±Ôz¦¡«ü©w¬YÅܼƫ¬ºA¡Aµ²ªG³oӰʧ@¨S¦³³Q°õ¦æ¡A´N²£¥Í¤F IsMiissing ªºª¬ºA¡A¶Ç¦^ȬO True or False¡C
Å¥¤£À´¡A¨SÃö«Y¡A¤£n»¡§A¬Ýªº¤H¬Ý¤£À´¡A§Ú¼gªº¤H¤@¼Ë¬Ý¤£À´¡A¦pªG§A¬Oµ{¦¡»y¨¥ªì¾ÇªÌ¡A·|À´¨º¬O¤Ñ¤~¡C
¦]¦¹¤£Á¿¤Ó¦h²z½×¡A¥uÁ¿¹ê»ÚÀ³¥Î¡A§ÚÌ¥i¥H¥u°Ý IsMissing() ³o¨ç¼Æ¨ì©³¤°»ò®ÉÔ·|False¡A¤°»ò®ÉÔ·| True¡C
¤°»ò®ÉÔ IsMissing()=True¡G
IsMissing ÀˬdÅܼÆȮɡA¥u¦³ Åܼƫ¬ºA¬O Variant ®É¤~¦³§@¥Î¡A¨ä¥L«¬ºAÅܼƥû·¬O False ¡A¤£¥i¯à¬O True¡C¦]¬°¥u¦³ Variant ³oºØ¤£©T©w«¬ºAÅܼƤ~¦³«¬ºA¤£½T©wªºª¬ªp¡A¨ä¥L©T©w«¬ºAÅܼơA·í¨ä³Q«Å§i®É´N¤w«ü©w¤FÅܼƪº«¬ºA¡C
§AÅ¥¤F¤@©w«Ü°ª¿³ªº¹ê°µ¤@¤U¡A§A¥i¯à¡G
Dim varVariant As Variant (©Î¥u¬O Dim varVaraint ¡A®ÄªG³£¤@¼Ë)
Debug.Print IsMissing(varVariant)
§A·|µoıµ²ªGÁÙ¬O False
³o®É§A©Î³\¥H¬°n¥Î varVariant= ¬YÅܼƫá¡A¤~¯à¨Ï IsMissing(varVariant) = True ¡A¨Æ¹ê¤W§Aªº Variant ÅܼƴN·|¨ú±o¥t¤@Åܼƫ¬ºA¡A·íµM§ó¤£¥i¯à IsMissing¡C
©M IsEmpty() ¨ç¼Æªº¤ñ¸û¡G
¦pªG§A§ï¥Î Debug.Print IsEmpty(varVariant) §A·|µoıµ²ªG¬O True¡C
¦Ó¥Î varVariant= ¬YÅܼƫá¡ADebug.Print IsEmpty(varVariant) µ²ªG¬O False ¡C
¤]´N¬O¥Î¦P¼Ë¬OÀˬd Variant «¬ºAªº¨ç¼Æ IsEmpty (²³æ¸ÑÄÀ¬°©|¥¼³Q½á¤©Åܼƫ¬ºA)¡A¤~¯à¬d¥X Varaint ÅܼƦ³¨S¦³¦b«Å§i«á¡A±µ¦¬¥t¤@ÅܼƤ§«¬ºA¤Î¤º®eÈ¡C
§ó°g½k¤F¶Ü¡H§Ú³o¼Ë¤À¿ë¨âªÌ¦n¤F¡G
IsEmpty ¬O»¡§AÁÙ¨Sµ¹¤@Ó Variant Åܼƫü©w«¬ºA¡C
IsMissing ¬O»¡§AµªÀ³nµ¹¤@Ó Variant Åܼƫü©wÅܼƫ¬ºA¡Aµ²ªG§A¶À¤û¡A¨Ã¨S¦³µ¹¥¦«ü©wÅܼƫ¬ºA¡F¤]©ÎªÌ»¡§ë¤â§ë¥X¤@Ó²y¡Aµ²ªG¦]¬°¬Yª¬ªp¡A®·¤â¨S±µ¨ì(©Ò¥H¤~¥s Missing ¹À)¡C
§A©Î³\»¡¹q¸£µ{¦¡¤@¬O¤@¡A¤G¬O¤G¡A¨º¦³¤°»òÁ¿«H¥Î¤£Á¿«H¥Îªº¡H¨ä¹ê¤£µM¡A¦pªG§A¦Ò¼{¨Ï¥ÎªÌ¿é¤Jªº¤£¤@P¡B¸ê®Æ¶Ç»¼ªº¿ò¥¢µ¥ª¬ªp¡A¨º IsMissing ªºª¬ªpÁÙ¯u¤£¤Ö¡C
¦n¤F¡An«ç»ò§e²{³oºØ¸ê®Æ
Missing ª¬ªp©O¡H¬Û«H§A·|°O±o¦³³\¦h
VB ªº¤èªk©Î¨ç¼Æ¡A¦b§ÚÌ Call
¥¦¤§«á·|¦³³\¦h°Ñ¼Æµ¹§ÚÌ¿é¤J¡A¦ý¤]¥i¥H¤£¿é¤J¡A¤£¿é¤J´N±Ä¹w³]È¡A¥¦ªºµ{¦¡±Ôz¦h¬O¡G
Private Function(or Sub) FuncName(ByVal varFirst
,Optional ByVal
varSecond................)
................µ{¦¡±Ôz.................
End Function(or Sub)
Optional
¤§«eªº°Ñ¼Æ¤@©wn¿é¡AOptional
¤§«áªº°Ñ¼Æ«h¥i¿é¥i¤£¿é¡A¦n¡A°ÝÃD¨Ó¤F¡A§ÚÌ«ç»òª¾¹D¨Ï¥ÎªÌ¦³¨S¦³¿é¤J³o¨Ç¥i¿ï¾Üªº°Ñ¼Æ¡H³o®É§A¥Î
IsMissing(varName)®É¡A·|µoı¦V¨Ó³£¬O
False ªº¨ç¼Æ¡A³o·|³ºÅܦ¨¤F True¡A¤]´N¬O¨Ï¥ÎªÌ¦pªG¦³¿é¤J¸Ó°Ñ¼Æ¡A¨º
IsMissing È·|¬O False
¡Aªí¥Ü¸ê®Æ¥¼¿ò¥¢¡A¦pªG¨S¿é¤Jªí¥Ü¸ê®Æ¿ò¥¢¡A¨äÈ·|¦¨¬°
True ¡C©Ò¥H If Not IsMissing Then
ªº§¹¾ãªº¥Îªk¬O
If Not IsMissing() Then
'¨Ï¥ÎªÌ¦³¿é¤J°Ñ¼Æªº³B²z¤èªk
Else
'¨Ï¥ÎªÌ¥¼¿é¤J°Ñ¼Æªº³B²z¤èªk
End if
³o¸Ì±ÁÙ¦³Ó IsEmpty ¨ç¼Æ¦³½ìªº²{¶H¡A´N¬O©ñ¦b Optional «á±ªº Variant ÅܼơA¤£ºÞ¥¦¦³¨S¦³¦¬¨ì¶Ç¨Óªº°Ñ¼Æ¡A¨ä IsEmpty Ȥ@«ß¬° False ¡A¤]´N¬O»¡¥un§A¦³»¡nµ¹¡AIsEmpty ´N¤£¦¨¥ß¡A¦Ü©ó¦³¨S¦¬¨ì¡AIsEmpty ¬OµLªk¥h¦V¤W¬dÃÒªº¡A¤]´N¬O»¡ IsEmpty ¥Î¦b Optional ±Ôz«áªº Vaaiant Àˬd¬O²@µL·N¸qªº¡C
¤d¥y¸U¥y¡A¤£¦p¤@¨Ò¡A½Ð°Ñ¦Ò¤U±ªº¤p½d¨Ò¡C
Option Explicit
Private Sub MissingCheck(Optional ByVal varArrive
As Variant, _
Optional ByVal varWord As String)
Print "----°Ñ¼Æ¶Ç»¼«á----"
Print "Dim varArrive As
Variant"
Print "IsMissing(varArrive)
is " & IsMissing(varArrive)
Print "IsEmpty(varArrive)
is " & IsEmpty(varArrive)
Print "----°Ñ¼Æ¶Ç»¼«á----"
Print "Dim varWord As
String"
Print "IsMissing(varWord)
is " & IsMissing(varWord)
Print "IsEmpty(varWord)
is " & IsEmpty(varWord)
End Sub
Private Sub Form_Click()
Dim varSend As Variant
Dim varString As String
Print "----¦b«Å§i°ÏùØ----"
Print "Dim varSend As
Variant"
Print "IsMissing(varSend)
is " & IsMissing(varSend)
Print "IsEmpty(varSend)
is " & IsEmpty(varSend)
Print "----¦b«Å§i°ÏùØ----"
Print "Dim varString As
String"
Print "IsMissing(varString)
is " & IsMissing(varString)
Print "IsEmpty(varString)
is " & IsEmpty(varString)
MissingCheck
End Sub
Private Sub Command1_Click()
Text1.Text = "HoneyPie °Ý" + vbCrLf
Text1.Text = Text1.Text + _
"text1 ³oÓ textbox ªº text ÄݩʧïÅܤF" + vbCrLf
Text1.Text = Text1.Text + _
"§Ú§Æ±æ´å¼Ð¯à¤@ª½¦b³Ì«á¤@¦æ" + vbCrLf
Text1.Text = Text1.Text + _
"¤£ª¾¹D«ç»ò°µ¨ì? ÁÂÁÂ"
Text1.SetFocus
End Sub
Private Sub Text1_Change()
'«ÂI!!³o¼Ë¥i¥H§â¹C¼Ð©ñ¨ì Text ªºµ²§À
Text1.SelStart = Len(Text1.Text)
End Sub
Text1.MultyLine=true
text1.scrollbars=2
³o¨âÓÄÝ©Ên¥ý¦b³]p¶¥¬q³]¦n¡A¦]¬°¥¦ÌµLªk¥Îµ{¦¡±Ôz¨Ó§ïÅÜ¡C
daisy ¼¶¼g©ó¤å³¹
½Ð°Ývb5.0¦p¦ó§â¤@Ó¸ê®Æ§¨·h¨ì¥t¤@Ó¦a¤è¥h¡AÁÙ¦³¦p¦óª¾¹D¤@Ó¸ê®Æ§¨¬O§_³Q¦s¦b?
¦Ñ©Çµª¡G
Private Sub Command1_Click()
Dim SourcePath As String, TargetPath As String
Dim CheckString As String
'³]©wÀɮ׽ƻs¤§¨Ó·½¤Î¥Øªº
SourcePath = "c:\icons"
TargetPath = "c:\tempb"
'Àˬd¨Ó·½¸ô®|¬O§_¦s¦b
CheckString = Dir(SourcePath, vbDirectory)
'¤£¦s¦bÅã¥Ü MsgBox °T®§
If CheckString = "" Then GoTo FileNotFound
Me.MousePointer = 11
'Àˬd¥Øªº¸ô®|¬O§_¦s¦b
CheckString = Dir(TargetPath, vbDirectory)
'¤£¦s¦b«h MkDir
If CheckString = "" Then
MkDir TargetPath
End If
'¬°¨Ó·½¸ô®|¦r¦ê§À¥[ "\" ¦r¦ê(¤~¯à¦V¤U·j´M)
If Right(SourcePath, 1) <> "\" Then
SourcePath = SourcePath + "\"
End If
'¬°¨Ó·½¸ô®|¦r¦ê§À¥[ "\"
If Right(TargetPath, 1) <> "\" Then
TargetPath = TargetPath + "\"
End If
'«·s³]©w¤@¦¸ Dir ±Ò©l¸ô®|
CheckString = Dir(SourcePath)
'§ä¤£¨ìÀɮפF¤~µ²§ô
Do While CheckString <> ""
If Not (CheckString = "." Or CheckString = "..") Then
FileCopy SourcePath & CheckString, TargetPath & CheckString
CheckString = Dir
End If
Loop
Me.MousePointer = 0
Exit Sub
FileNotFound:
MsgBox SourcePath & " ¥Ø¿ý¤£¦s¦b", vbOKOnly, "Àɮ׸ô®|¿ù»~"
End Sub
¥H¤W¥u¬O¤@¼h¥Ø¿ýªºÀÉ®× Copy ¡AYn§t©Ò¦³¤U¼h¤l¥Ø¿ýÀɮסA½Ð¨ìCWW http://sunh.hosp.ncku.edu.tw/~cww/ VB¤ß±oµ§°O§ä¤@½g¤l¥Ø¿ýÀÉ®×·j´Mªº½d¨Ò¡C
«i´±ªº®ü¤ý¤l ¼¶¼g©ó¤å³¹
¦pªG§Ú·Q§âtext1.text³]¦¨¤@Ó¦r¦ê°}¦C¡A¬O¤£¬Oª½±µ¼g¦¨
- dim s[10]
- s[10]=text1.text
¦Ñ©Çµª¡G
§A³o¼Ëªº¼gªk¬O«Å§iªø«×¬° 11 (1~10) ªº¤@Ó°}¦C¡A¨Ã§â Text1.Text ©ñ¶i²Ä¤Q¤@Ó°}¦CùØ¡A¨Ã¤£¬O§â Text1.Text ©î¦¨³æ¦r©ñ¦b S() ùتº·N«ä¡An°µ¨ì©î¦r¦ê¡A½Ð°Ñ¦Ò¤U¨Ò¡G
Dim S() As String * 1
Private Sub Command1_Click()
Dim I As Long
For I = 0 To Len(Text1.Text)
ReDim Preserve S(I)
S(I) = Mid(Text1.Text, I + 1, 1)
Print S(I)
Next
End SubÂÇ¥Ñ S() °ÊºA°}¦C«Å§i¡A¤Î Redim S() °}¦Cªø«×¡A¥i¥H°µ¥Xè¦n²Å¦X Text1.Text ªø«×ªº°}¦C¡C
ªü§Ó ¼¶¼g©ó¤å³¹
½Ð°Ý§Ú¦p¦ó³]pµ{¦¡¡A¨Ï±o§Úªºµøµ¡¤º®e¤]·|¸òµÛ§ïÅÜ¡C¨Ò¦p·í§Ú§ïÅܵøµ¡¤j¤p®É¡A§Únµøµ¡¤ºªºFRAME,PICTURE,TOOLBAR¤]¸òµÛ¤ñ¨Ò§@¥Î¡C
¦Ñ©Çµª¡G
¤G©j ¼¶¼g©ó¤å³¹
·Q½Ð±Ð¤@¤U ¦b TextBox Edit ´Á¶¡¶¶«Kformat¦p¦ó§@¡A¨Ò¦p ºV1234 ==> 1,234 ¦Ó¥B·|¥k¾a...
¦Ñ©Çµª¡G
Private Sub Text1_Change()
Text1.Text = Format(Text1.Text, "#,###")
Text1.SelStart = Len(Text1.Text)
End Subª`·N¡G½Ð¥ý¦b³]p¶¥¬q³]©w¦n
- Text1.Alignment=1
- Text1.Multiline=True
Cheng Tom ¼¶¼g©ó¤å³¹
¦p¦ó±N¼ÆÓ Label ¤¤ªº¸ê®Æ (Caption)¦s¤J¤@ .TXT ¼Ð·Ç®æ¦¡ªº¤å¦rÀɤ¤¡H
¦Ñ©Çµª¡G
Private Sub Command1_Click()
Dim FileHandle As Integer
Dim I As Integer
Dim PutString As String
FileHandle = FreeFile
Open "c:\temp\label.txt" For Output As #FileHandle
For I = 0 To Label1.Count-1
PutString = PutString + Label1(I)
Next
Print #FileHandle, PutString
Close #FileHandle
End Sub
Private Sub Form_Load()
Label1(0).Caption = "¦p¦ó±N¼ÆÓ Label ¤¤ªº¸ê®Æ"
Label1(1).Caption = "(Caption) ¦s¤J¤@ .TXT"
Label1(2).Caption = " ¼Ð·Ç®æ¦¡ªº¤å¦rÀɤ¤¡H"
End Sub
pony ¼¶¼g©ó¤å³¹
½Ð°Ý VB5 ¦³¨S¦³ PI ³oÓ±`¼Æ
Kevin 榭G
¨S¦³¡A¤£¹L const pi = 3.14159265358979À³¸Ó¤w¸g¹Lºë½T¤F§a...§A¤]¥i¥H¥Îpi = 355/113 (±K²v¡A¤£¬O¨º»ò·Ç...)¡C
¦Ñ©Ç´¡ªá¡G
«Ø¤@Ó MyOwn.bas¡A¦bùر«Å§i Public Const user_PI As Double = 3.14159265358979¡A¦n¤F¡A¥H«á§Aªºµ{¦¡´N¥i¥H¦³ PI ³oÓ±`¼Æ¤F¡C
¦Ñ©Ç¡G
¦Ñ©Ç¡G
- '³o¬O¤@Ó«³]¤@Ó Form ©Ò¦³ Control ªºµ{¦¡°Ï¬q¡A
'Resume Next ªí¥Ü¦³¿ùÄ~Äò©¹¤U°õ¦æ
On Error Resume Next
'²¾°Ê¨Ã½Õ¾ã±±¨î¶µ¤j¤p
For I = 0 To Me.Controls.Count - 1
With Me.Controls(I)
.Move .Left * XScale, .Top * YScale, _
.Width * XScale, .Height * YScale
'³\¦h Control ¨Ã¨S¦³ Font ÄÝ©Ê¡A©Ò¥H¦pªG¨S¦³
'On Error Resume Next ±Ôzµ{¦¡·|³Q¤¤Â_¦b³oùØ
.FontSize = .FontSize * (XScale + YScale ) / 2
'«á±¨S±µ¥ô¦ó¿ù»~³B²z±Ôz¡A·í¨Sµo¥Í¹L
End With
Next
(inkfish)¤§»Ê¨¥¡G
- ª±¹L¬õ¦âĵ§Ù³oÃþ"§Y®É¾Ô²¤"ªºª±®a³£À³¸Óª¾¹D¥¦ªºª±ªk¡A¤]´N¬O§Ú¤è¥i¤£Â_²¾°Ê³æ¦ì¨Ó³¡ÄݩάO§@¾Ô¡A¦P¤@®É¶¡¤º¹q¸£©Ò±±¨îªºª±®a¤]¦P®É¶i¦æ³o¨â¶µ°Ê§@¡C
- °ÝÃD¨Ó¤F¡A°²¦p¤j®aÁÙ¨S§Ñ°Oªº¸Ü ·í®É¬õ¦âĵ§Ù¤W¥«®ÉÁÙ¬O 80486 CPU¡A¥[¤W DOS 6.xªº§@·~¨t²Î ´«¥y¸Ü»¡ ·í®ÉªºDOS ÁÙ¤£¬O¤@Ó¦h¤uªº¨t²Î¡A¦ý¬O¬õ¦âĵ§Ùª±°_¨Ó«o·Ù¦³¨ä¨Æ ¦n¹³¦³¦h¤uªº¼Ë¤l(¾Ô¨®¥i¦Û¥Ñ²¾°Ê¤£¶·¹q¸£°Êª±¤~¯à°Ê ´«¨¥¤§ ¨S¦³¦^¦Xªº¨î)
- ©Ò¥H½Ð°Ý¤@¤U n¦p¦ó¦b¤@Ó¨S¦³¦h¤uªº¨t²Î¤W¼ÒÀÀ¥X¤@Ó¦h¤uªº¼Ë¤l?°²¦p§ï¦b²{¦bªº¦h¤u§@·~¥¥x ¦pWIN95¥H¤Wªº¨t²În¦p¦ó°µ¨ì¦¹¤@¥\¯à©O?thread¶Ü?
¦Ñ©Çµª¡G
³o¸ò¦h¤u¤°»òÃö«Y«¨¡A§O§â°ÝÃDÅͪº¨º»ò½ÆÂø¡C
- ³o¥s´Ñ¤l¾ÞÁa¼Ò¦¡¡C
- ¦^¦X¨î±Ä¥Î¤À§O´Ñ¤l¾ÞÁa¼Ò¦¡¡A¤]´N¬O¼Ä¤è´Ñ¤l¥Ñ¹q¸£¾ÞÁa¡A¨Ï¥ÎªÌ´Ñ¤l¥Ñ¨Ï¥ÎªÌ¾ÞÁa¡C
- §Y®É¨î±Ä¥Î²Î¦X´Ñ¤l¾ÞÁa¼Ò¦¡¡A¤]´N¬OÂù¤è´Ñ¤l³£¥Ñ¹q¸£¾Þ§@¡A¥u¬O¹q¸£¤¹³\¨Ï¥ÎªÌ§ïÅܧڤè´Ñ¤l¦æ¬°¼Ò¦¡¦Ó¤w¡C
- §ÚÌ¥i¥H³o»ò·Q¡A¹q¸£¥Ñ¤@Ӯɶ¡¾¹(Timer) ¹j¤@¬q®É¶¡¥h°Ê¤@¤U¼Ä§ÚÂù¤èªº©Ò¦³ºX¤l¡A¤]´N¬O»¡¨Ï¥ÎªÌ¦pªG¤£°Ê§@¡A¨ä¹ê´N¬O¬Ý¹q¸£¦Û¤v¦b¤U´Ñ¡C
- ¦ý¤@¥¹¨Ï¥ÎªÌ«ü©w¬Y´Ñ¤l®É¡A¸Ó´Ñ¤l²¾°Ê«ü¼Ð´N³Q¼Ð¬° False ¡A¦p¦¹¹q¸£¦b¨C¤@´Ñ¨B¤¤¸I¨ì¸Ó´Ñ¤l´N¤£·|¹ï¥¦¦³©Ò°Ê§@¡A¦ý¨ä¥L´Ñ¤l«hÄ~Äò°Ê§@¡Aª½¨ì¨Ï¥ÎªÌ³]©w§¹¸Ó´Ñ¤l¦æ°Ê¤è¦¡«á¡A¦æ°Ê«ü¼Ð«ì´_¬° True ¡A·N«ä´N¬OÄ~Äò¥æÁÙ¹q¸£±±ºÞ¡C
- ¥Î¤@ӳ̲³æªº VB ¼Ò«¬¨Ó»¡©ú¡G
Type ´Ñ¤l¼Ò¦¡
¦æ°Ê«ü¼Ð As Boolean
¦æ¬°¼Ò¦¡ As SomeValue
End Type
'°²³]¦³¤QÁû´Ñ¤l
Dim ´Ñ¤l(9) AS ´Ñ¤l¼Ò¦¡
Sub Form_Load()
Dim I As Long
´Ñ¤l(0).¦æ¬°¼Ò¦¡=¼ÄA
´Ñ¤l(1).¦æ¬°¼Ò¦¡=¼ÄB
.
.
´Ñ¤l(5).¦æ¬°¼Ò¦¡=§ÚA
´Ñ¤l(6).¦æ¬°¼Ò¦¡=§ÚB
.
.
For I=0 To Ubound(´Ñ¤l)-1
´Ñ¤l.¦æ°Ê«ü¼Ð=True
Next
End Sub
Sub ´Ñ¤l_Click(Index As Integer)
´Ñ¤l(Index).¦æ°Ê«ü¼Ð=False
Call ¦æ¬°¼Ò¦¡§ïÅÜ(Index)
End Sub
Sub ¦æ¬°¼Ò¦¡§ïÅÜ(Byval ¶Ç¤JÈ)
'...............¦æ¬°¼Ò¦¡§ïÅܳ]©w
´Ñ¤l(¶Ç¤JÈ).¦æ¬°¼Ò¦¡ =·s¦æ¬°¼Ò¦¡
´Ñ¤l(¶Ç¤JÈ).¦æ°Ê«ü¼Ð=True
End Sub
Sub Timer_Timer()
Dim I As long
For I=0 to UBound(´Ñ¤l)-1
If ´Ñ¤l(I).¦æ°Ê«ü¼Ð=True Then
Call ´Ñ¤l¦æ°Ê (´Ñ¤l(I).¦æ¬°¼Ò¦¡)
End If
Next
End Sub
Sub ´Ñ¤l¦æ°Ê(ByVal ¶Ç¤JÈ)
Select Case ¶Ç¤JÈ
Case ¼ÄA
¼ÄA ¼Ò¦¡¦æ°Ê®i¶}
Case ¼ÄB
¼ÄB ¼Ò¦¡¦æ°Ê®i¶}
.
.
Case §ÚA
§ÚA ¼Ò¦¡¦æ°Ê®i¶}
Case §ÚB
§ÚB ¼Ò¦¡¦æ°Ê®i¶}
.
.
End Sub
¦Ü©ó¾Ô¨®¶]´X¨B¡A¤h§Lµo´Xºj¡A³Q K ¦h¤Ö¤U¤~·|°}¤` ¡A¥iɦ欰¼Ò¦¡ªº¼W¥[¨Ó³]©w¡A¤£¹L³oºØ¦U§LºØ¤£¦PÄݩʪº³]©w¡A¤£ºÞ¦^¦X¨î©Î§Y®É¨î³£»Ýn¦³¦¹ºØ¾÷¨î¡A¤£ºc¦¨Âù¤è¤À§Oªºn¥ó¡C#¤W¨Ò¯Â¬°¤@ºØºc·Q¼Ò¦¡¡A½Ð¤£n§â³o¨Ç Copy ¨ì Form ùØ°õ¦æ¡C#
±H¥óªÌ: richo
¤p§Ìªºµ{¦¡½X¦p¤U¡G
Private Sub CancelPrint_Click()
printer.killdoc
end sub
±¡ªp¬O¡Gµ{¦¡°õ¦æ¤¤«ö¤U¦¹CancelPrint«öÁä«á¡A¦Lªí¾÷¨Ì¼Ë±N±ý¨ú®ø¦C¦L¤§¸ê®Æ¦L¥X¡C
¦Ñ©Çµª¡G
Printer.KillDoc n¦b Printer.EndDoc ¤§«e¤~¯à²×¤î¦C¦L¡A¤@¥¹§A EndDoc ¡A´N¨S¿ìªk¨ú®ø¤F¡A§A¥i¥H¤À§O´ú¸Õ EndDoc ¤§«eªº KillDoc¡A©M EndDoc ¤§«áªº KillDoc ¡A¨Ã§â¦Lªí¾÷µøµ¡¶}¦b®ÇÃä¡A§A´N·|¬Ý¥X¨âªÌ¤£¦P¤F¡C
¶³²H·»´
¬O§_¥i¥H±Nformªºname¶Ç¨ì¤@Ófunction¡AµM«áload³oÓform©O¡H
¦Ñ©Çµª¡G
- ¥ý¥Î¤@Ó Module ¼g¤J¤U¦C±Ôz¡A¨Ã§â±M®×±Ò°Êª«¥ó§ï¬° Sub Main
Option Explicit
'«Å§i¤@Ó¶°¦XÅܼơA·Ç³Æ§â©Ò¦³ªº±M®× Form ª«¥ó¥á¶i¨Ó
Public FormCollect As New Collection
Sub Main()
Dim varForm As Form
'¦b³oùؼg©ú§A±M®×¤¤©Ò¦³ªºªí³æ
Set varForm = New Form1
'§â Form1 ªº°Ñ·Óª«¥ó¥á¨ì FormCollect ¶°¦Xª«¥óùØ¡A
'§â¯Á¤ÞÁä³]¬° Form.Name
FormCollect.Add varForm, "Form1"
Set varForm = New Form2
FormCollect.Add varForm, "Form2"
Set varForm = New Form3
FormCollect.Add varForm, "Form3"
'¨ú¥X Form1 °Ñ·Ó¡A°µ¬°²Ä¤@ÓÅã¥Üªí³æ
FormCollect.Item("Form1").Show
End Sub- ¦b§A²Ä¤@ÓÅã¥Üªí³æùØ°µ¤U±ªº±Ôz¡A´N¥i¥H¥H¦WºÙ±Ò°Ê©Ò¦³ªí³æ
Option Explicit
'¨Ì¶Ç¤J¦r¦ê¨M©wªí³æ±Ò°Êªº°Æµ{§Ç
Private Sub ShowForm(ByVal varFormName As String)
Dim I As Integer
'³vµ§®Ö¹ïªí³æ¬O§_¤w¸ü¤J
For I = 0 To Forms.Count - 1
'¦p¤w¸ü¤J«hĵ§i
If Forms(I).Name = varFormName Then
MsgBox "ªí³æ¤w¸ü¤J"
Exit Sub
End If
Next
'§â¦P¦Wªºªí³æ°Ñ·ÓÅã²{¥X¨Ó
FormCollect.Item(varFormName).Show
End Sub
'¿ï¤@Óªí³æ¸ü¤J
Private Sub Combo1_Click()
ShowForm Combo1.List(Combo1.ListIndex)
End Sub
Private Sub Form_Load()
Dim I As Integer
'§âªí³æ°Ñ·Ó¦WºÙ¥á¨ì Combo1 ùØ
For I = 1 To FormCollect.Count
'ª`·N¡A·í§A¤Þ¥Î¤@¥¼¸ü¤Jªí³æ¤§ÄݩʮɡA
'ªí³æ·|¦Û°Ê¸ü¤J
Combo1.AddItem FormCollect.Item(I).Name
Next
'§â¦Û°Ê¸ü¤Jªºªí³æ UnLoad ¡A¥H¸`¬Ù°O¾ÐÅé
For I = 0 To Combo1.ListCount - 1
'¦Û¤vªºªí³æ¤£n UnLoad
If Not Combo1.List(I) = Me.Name Then
Unload FormCollect.Item(I + 1)
End If
Next
End Sub
Private Sub Form_Unload(Cancel As Integer)
'±j¢ªí³æÃö³¬
UnLoad Me
End Sub- ³o¤@¬q²o¯A¤F«Ü¦h Forms ¤Î Form_Load ªº°ò¥»Æ[©À¡A¦Ñ¹ê»¡n¤£¬O¶³²H·»´³o»ò°Ý¡A§Ú¤]¤£·|·Q¨ì¥i¥H³o¼Ë°µ¡A§Ú¥i¥H³o»ò¸ò¤j®a»¡¡A¦b§Oªº±Ð¬ì®Ñ¤Î½Ò°óÁ¿¸q«Ü¤Ö³o»ò±Ðªº(©Î³\§Ú©tº|¹è»D¨S¬Ý¹L)¡A©Ò¥H½Ð¦U¦ìªì¾Çª©¤Í¤@©w¦Û¤vn Copy ¤U¨Ó¸Õ¸Õ¬Ý¡A¦³¨º³¡¥÷¤£À´ Post ¤W¨Ó°Ý¡A§Ú¦A¸Ô²Ó¸ÑÄÀ¡A¦Ó¦¹¨Ò¤§©Ò¥H«n¡A¬O¦]¬°§A¥i¥H¥Î³oºØ¤è¦¡¡A¥H Name String »´©öªº¾ÞÁa¤j³¡¥÷ªº VB ª«¥ó¡A¦Ó¨º¨Çª«¥ón¥[¤J°Ê§@¡A¨º¨Çª«¥ón±Æ°£°Ê§@¡AÂÇµÛ Collection ªº Add ©M Remove ¥i¥H»´©ö¹F¦¨¡C
- Collection ¶°¦Xª«¥óÅܼƬO VB ùØ¥\¯à¶W¯Å±j¤jªºª«¥óÃþ«¬¡A¤£¥u¦³ Variant ªº¤°»òÅܼƳ£¥]ªº¯S©Ê¡A¤ñ Variant §ó±jªº¬O¥¦´£¨Ñ¤F°£ Index ¤§¥~ Key È¥i¨Ñ¨ú¥Xª«¥ó¤º®e¡A¦ý«Ü¤Ö¬Ý¨ì VB ª©¤Íªº Code ¦³¦b¥Î Collection ªº¡A¦pªG§AÁÙ¨S¥Î¹LCollection ¡A§Æ±æ§A»°§Ö½ Help ¡A¸ÕµÛ¨Ï¥Î¡C
¨«¹L¥|¤è¦^¨ììÂI ¼¶¼g©ó¤å³¹
¹³¬OÅwªïµe±µ¥ªí³æ §Ú·Q§â¥¦³]©w¦¨²Ä¤@±in«ç»ò°µ°Ú¡H
¦Ñ©Çµª¡G
Äúµ§¤p¬P¬P ¼¶¼g©ó¤å³¹
½Ð°ÝVB5¤¤©w¸q¦Ûq«¬ºA¤¤¥i¤£¥i¦A©w¸q¥t¤@Ó¦Ûqtype
¦Ñ©Çµª¡G
±H¥óªÌ: James Wu
¥D¦®: ½Ð°Ý¡G±ý±N¦r¦ê¦s¤JÀɮפ¤¡An¦p¦ó°£¥hº§ÀªºÂù¤Þ¸¹¡A¨ÏÂù¤Þ¸¹¤£¦s¤J©O¡H
¦Ñ©Çµª¡G
VB File I/O ¦³´XºØ¼Ò¦¡¬O¦¨¹ï¨Ï¥Îªº¡G