¤ÀÃþ |
¼ÐÃD |
¤j·N |
§@ªÌ |
¤é´Á |
¤¸¥ó¥Îªk | ComboBox ªº¨Ï¥Î§Þ¥© | ¡@ | ¦Ñ©Ç | 1998/5/26 |
¤¸¥ó¥Îªk | ActiveX ¥\¯àªí½s¿è¾¹ªº¨Ï¥Î | ¡@ | ¦Ñ©Ç | 1998/6/4 |
¤¸¥ó¥Îªk | CommonDialog ªº Cancel ³qª¾ | ¥H Err.Number ¨ú¥N Event | ¦Ñ©Ç | 1998/7/12 |
ª«¥ó¨Ï¥Î | TextBox ªº½Æ»s¤Î¶K¤W | ClipBoard ªº¨Ï¥Î | ¦Ñ©Ç | 1998/5/30 |
ª«¥ó¨Ï¥Î | ¨ú±o¬Y¹q¸£ªº©Ò¦³¦r«¬ | Screen ©M Printerªº¨Ï¥Î | ¦Ñ©Ç | 1998/6/5 |
¶°¦Xª«¥ó | Form.Controls ªº¨Ï¥Î | ¡@ | ¦Ñ©Ç | 1998/5/28 |
¤¤¤å³B²z | ¦p¦ó§P§O¤@Ó¦r¤¸¬°¤¤¤å¦r | ¡@ | ¦Ñ©Ç | 1998/5/28 |
¤¤¤å³B²z | TextBox ªº¤¤^¿é¤J¤Á´«¥\¯à | IMEMode Äݩʪº§Q¥Î | ¦Ñ©Ç | 1998/6/7 |
¦r¦ê³B²z | VB Script SPLIT() ¨ç¼Æ¼ÒÀÀ | Vb ¦r¦ê¨ç¼ÆªºÁa¦X¹B¥Î | ¦Ñ©Ç | 1998/6/5 |
¦r¦ê³B²z | ¤å¦rÀɪº¦r¦ê´À´« | ¡@ | ¦Ñ©Ç | 1998/6/9 |
¦r¦ê³B²z | ç°£¦r¦ê¤¤ªº«ü©w¦r¤¸ | Mid() ¨ç¼Æªº¹B¥Î | ¦Ñ©Ç | 1998/6/16 |
¦r¦ê³B²z | ¦p¦ó°µ¥X¶]°¨¿O®ÄªGªº TextBox | ¡@ | ¦Ñ©Ç | 1998/6/14 |
ÅܼƳB²z | ÅܼưO¾ÐÅéªÅ¶¡ªºÄÀ©ñ | ¡@ | ¦Ñ©Ç | 1998/5/29 |
°Æµ{¦¡ | ¸ó Form ªº Procedure ©I¥s | ¡@ | ¦Ñ©Ç | 1998/7/2 |
¼ÆȳB²z | ¤£¦P¶i¦ì¼ÆªºÂà´« | Hex() & Oct() | ¦Ñ©Ç | 1998/5/31 |
¤é´Á³B²z | ¨D±o¨C¤ëªº³Ì«á¤@¤Ñ¬O´X¸¹ | DateSerial() ªº¹B¥Î | Rose | 1998/6/10 |
¨ä¥LÂø¶µ | ¥~³¡Àɮתº°õ¦æ¤Î²×¤î | Shell ©M AppActivate¨Ï¥Î | ¦Ñ©Ç | 1998/6/16 |
¤¸¥ó¥~Æ[ | Drag ®ÉÅã¥Ü Picture | Drag ©M DragMode | ¦Ñ©Ç | 1998/6/18 |
¤¸¥ó¥~Æ[ | Drag ©M Move ªº¤ñ¸û | ¥Ñ¨Ï¥ÎªÌ¾Þ±±¤¸¥ó²¾°Ê | ¦Ñ©Ç | 1998/6/18 |
¹Ï§Î³B²z | VB 5.0 ¥i¥H¨Ï¥Îªº¹ÏÀɮ榡 | ¡@ | ¦Ñ©Ç | 1998/7/20 |
¹Ï§Î³B²z | ¦p¦ó¦Û»s MetaFile | VB »P Office 97 | ¦Ñ©Ç | 1998/7/20 |
iroi ¼¶¼g©ó¤å³¹
½Ð°Ý¦U¦ì,vbªºcombo box«ç¥Îªº
¦Ñ©Çµª¡G
¦b°µ Comboboxªº§PÂ_®É¡A¦³´XÓnª`·N°t¦X¨Ï¥ÎªºÄݩʬO
¨ú¥X ComboBox ùتºÈ
'------¨ú¥X¥H·Æ¹«ÂI¿ïÈ
'-----¨ú¥X·s¥[¤JªºÈ
'---- ±N²Õ¦X¦¡¤å¦r®Ø¥[¤J Combo1
Eagle Tsui ¼¶¼g©ó¤å³¹
½Ð°Ý¥Îvb5¦p¦ó¥i¥H¦b¥þ¤£ª¾±¡¤Uª¾¹DForm1¦³ÃäÉAControl§r!
¦Ñ©Çµª¡G
pºâ form ¤W¦³´XÓ Control
Debug.Print me.controls.count
¦C¥X form ¤W©Ò¦³ control ªº¦WºÙ
Dim VarCont As Control
For Each VarCont In Me.Controls
Debug.Print VarCont.Name
Next
html ¼¶¼g©ó¤å³¹
¦Ñ©Çµª¡G
Strlength=LenB(StrConv("YourChar", vbFromUnicode))
Strlength=1 ^¤å
Strlength=2 ¤¤¤å
±H¥óªÌ: Annie Chiu
¦ó²M°£°O¾ÐÅéÅܼÆ?
¦Ñ©Çµª¡G
°}¦CÅܼƪºÄÀ©ñ¡G
¨Ï¥Î Erase Array ²M°£ Array °}¦CÅܼƪºÈ¡A¦ýìºû«×¤£ÅÜ¡A¥u¬O±N°}¦C¤º§tȲM°£¦Ó¤w¡A¾A¥Î¥H Dim Array(©T©wºû«×¼Æ¥Ø) As SomeVarType ªºÀRºA°}¦C«Å§i¡C
Redim Array(ºû«×¼Æ¥Ø) ¡A²M°£°}¦CÅܼƪºÈ¡A¨Ã§ïÅܺû«×¼Æ¥Ø¡A¾A¥Î¥H Dim Array() As SomeVarType ªº°ÊºA°}¦C«Å§i¡C
«Å§i°Ïùبp¦³Åܼƪº¥Í©R´Á¡G
°ò¥»¤W¤@ÓÅܼƦp¬° dim ©Î private «Å§i¡A«Å§i¥¦ªº procedure µ²§ô«á¡AÅܼƦ۰ʷ|³QÄÀ©ñ¡C¦ý«Å§i¦b Form ªº¤@¯ë°Ïùتº¨p¦³ÅܼơA¬O³Q°O¸ü¦b form ªº initialize ¨Æ¥óùØ¡A¦Ó initialize ¥u·|¦b form ²Ä¤@¦¸³Q load ®É²£¥Í¤@¦¸¡A·í§A¦A¦¸ Load Form «á¡A´N¤£·|¦A¦³ initialize ¤F¡A³o¤]·N¨ýµÛ¦b initialize ùثŧiªºªF¦è¡A·|«ùÄò¨ì¾ãÓµ{¦¡µ²§ô¤~·|³Q²M±¼¡C
ª«¥óÅܼƪº°O¾ÐÅéªÅ¶¡ÄÀ©ñ¡G
Dim ObjectArray As SomeObjectType ªº«Å§iÁöµM½á»P ObjectArray ª«¥óÅܼƪº«¬ºA¡A¦ý¦b Set ObjectArray=OtherObject ¤§«e¡A¬O¤£¨ã¦³ªìȪº¡A¤@¥¹°õ¦æ Set ObjectArray=OtherObject ±Ôz«á¡AObjectArray §Y³Q½á»P¦U¶µª«¥óÈ¡AnÁÙì ObjectArray ì©lª¬ºA¡A¶· Set ObjectArry = Nothing¡C
°ÊºA±±¨î¤¸¥óªº·s¼W»PÄÀ©ñ¡G
©Ò¦³ªº±±¨î¤¸¥ó¤Î Form ª«¥ó¡A§Ú̳£¥i¥H§â¥Lµø¬° Public ÅܼơA¬J¸g²£¥Í¡A¦b¥ô¦ó Procedure ³£¯à©I¥sªº¨ì¡C
· ¼¶¼g©ó¤å³¹
½Ð°Ý¹³°O¨Æ¥»¤¤ªº½Æ»s¡B°Å¤U¡B¶K¤W¡ATextBox n¦p¦ó¼g¡H
¦Ñ©Çµª¡G
§¥¤H ¼¶¼g©ó¤å³¹
vbn¦p¦ó±N¤Q¶iÅÜ...¤G¶i...¤K¶i....¤Q¤»¶iµ¥
¦Ñ©Çµª¡G
johneson ¼¶¼g©ó¤å³¹
½Ð°Ý¦bvb Àô¹Ò¤U¦p¦ó¤@µøµ¡¦p¦ó¥h°õ¦æ¥t¤@µøµ¡©Ò¼gªºµ{¦¡½X
¦Ñ©Çµª¡G
¬y®öªº· ¼¶¼g©ó¤å³¹
¦bVB5¤¤ªºActiveX±±¨î¶µ,¯à¤£¯à¥Î¥\¯àªí½s¿è¾¹°Ú???¦³Ó«Ü©_©Çªº²{¶H...¦bªí³æªº§ÖÅã¥\¯àªí¤¤¦³¥\¯àªí½s¿è¾¹...¶i¥h¤§«á,¥i¥H³]©w³á...¤£¹LÃä¦n«á,¦bªí³æ¤¤¬Ý¤£¨£¥\¯àªí£z£°......¦³½Öª¾¹Dì¦]....
¦Ñ©Çµª¡G
· ¼¶¼g©ó¤å³¹
¦p¦ó¥ÎVB¨Ó¨ú±o¹q¸£¸Ìªº¦r«¬¨Ã¥B¥Î¤U©Ô¦¡¿ï³æ¨q¥X¨Ó...
¦Ñ©Çµª¡G
misckl ¼¶¼g©ó¤å³¹
¦bVB Script¤¤¦³¤@Ó SPLIT() ªº Function ¥i¥H±N¦r¦êÂন¦r¦ê°}¦C¡A¦Ó¦bVB5¤¤«o¨S¦³¡C¦bVB5¤¤¬O§_¦³Ãþ¦üªºFunction¡H©Î¬Oþ¸Ì¦³³oÓ Function?
¦Ñ©Ç¸Õ§@¡G
VB5 ùبèS¦³©M VBScript ¬Û¦Pªº SPLIT() ¨ç¼Æ¡A¦ý³z¹L VB5 ¦r¦êÅܼƪºÁa¦X¹B¥Î¡A§ÚÌ¥i¥H¦Û³Ð¨ã¦³ SPLIT() ¥\¯àªº¨ç¼Æ¡C
Function Split(ByVal Exp As String, _
Optional ByVal Deli As
String = " ", _
Optional ByVal
varCount As Long = -1, _
Optional ByVal Comp As
Integer = 0)
Dim ReturnArr() As String, ReturnNum As Long
Dim ShortWord As String, WordNum As Variant
If varCount = 0 Or Len(Exp) = 0 Then
SimuSplit = ReturnArr
Exit Function
End If
Do
WordNum = InStr(1, Exp,
Deli, Comp)
If WordNum = 0 Then
ShortWord = Exp
Else
ShortWord = Mid(Exp, 1, WordNum - 1)
Exp = Right(Exp, Len(Exp) - WordNum)
End If
On Error Resume Next
ReDim Preserve
ReturnArr(UBound(ReturnArr) + 1)
If Err.Number = 9 Then
ReDim ReturnArr(0)
End If
ReturnArr(UBound(ReturnArr))
= ShortWord
If WordNum = 0 Then
Exit Do
Loop
If varCount <> -1 And varCount <=
UBound(ReturnArr) Then
ReDim Preserve
ReturnArr(varCount - 1)
End If
SimuSplit = ReturnArr
End Function
¥£Áõ ¼¶¼g©ó¤å³¹
CommonDialog¨ä¤¤ªº ¶}±ÒÂÂÀɪºµøµ¡¤¤¡A¿ï¨ú "¨ú®ø" ©Ò·|¤Þµo¤§¨Æ¥ó¬°¦ó¡H
¦Ñ©Çµª¡G
¦pªG§A´¿¥J²Ó¦b VB5 ªº[ÂsÄýª«¥ó]¥\¯àùØ¥J²ÓÆ[¹î¹L CommonDialog ³oÓ¤¸¥ó¡A§A·|µoı CommonDialog ¨S¦³³]©w¥ô¦óªº¨Æ¥óµ{§Ç¡A¨º§Ú̸Ӧp¦ó±oª¾¥¦°õ¦æªºª¬ªp©O¡Hµª®×´N¦b¥¦ªº ErrorConstants ±`¼Æ«Å§iùØ¡C¤]´N¬O CommonDialog §â¥¿½T°õ¦æªº°Ê§@µ²ªG©ñ¦b¦U Property ÈùØ¡A¿ù»~«h²£¥Í¤@Ó Error ¨Ó³qª¾§A¡C¦¹¥~ Cancel ¦b CommonDialog ùعw³]Ȥ£¬O¿ù»~¡A¦ý¦pªG§AnÄdºI¨ì Cancel °T®§¡A¥u¦³³W©w«ö¤U Cancel µø¦P²£¥Í¤@Ó¿ù»~¡C¤]´N¬O¥²»Ý¥ý³]©w CommonDialog1.CancelError=Ture «á¡A¦A¥Î Err.Number ¨Ó°»´ú Cancel ªº¦æ¬°¡C½Ð°Ñ¦Ò¤U¨Ò¡C
Option Explicit
Private Sub Command1_Click()
On Error Resume Next
CommonDialog1.ShowOpen
If Err.Number = cdlCancel Then
MsgBox "FileOpen
Cancel"
End If
End Sub
Private Sub Form_Load()
CommonDialog1.CancelError = True
End Sub
Neuro Doc ¼¶¼g©ó¤å³¹
¦b VB 5.0 ¤U, ¦p¦ó¥Îµ{¦¡¤Á´«ª`µ¤Î^¤å¿é¤J?
¦Ñ©Çµª¡G
Vb 5.0 ¦b ¥i¥H¿é¤J¤å¦rªº Box (¦p TextBox,ListBox,ComBox....µ¥)ùØ¥[¤F¤@Ó¿é¤Jªk¤Á´«ªºÄÝ©Ê¡A´N¬O IMEMode¡A¥i¬O¥¦¦Û¤v»¡©úùسºµM°¦¦r¥¼´£¡A¤£¹L¸g¦Ñ©Ç´ú¸Õ¡A¯uªº¦³§@¥Î¡C°t¦X¤W ImeStatus ³oÓ¨ç¼ÆÀË´ú¥Ø«eªº¿é¤Jª¬ºA¡A¦b§A¿é¤J¤å¦r®É¡A´N¥i¥H¾Þ±±¨Ï¥ÎªÌªº¿é¤Jª¬ºA¡C
James Wu ¼¶¼g©ó¤å³¹
±ý§â¤å¦rÀÉ(filename.txt)¤¤¬Y¤@¦r¦ê(beforchange)§ï¬°(afterchange),¦p¦ó¼g?
¦Ñ©Çµª¡G
½Ð°Ñ¦Ò¤U¦C½d¨Òµ{¦¡¡G
VERSION 5.00
Begin VB.Form Form1
Caption
= "Form1"
ClientHeight = 3885
ClientLeft =
60
ClientTop =
345
ClientWidth =
4680
LinkTopic =
"Form1"
ScaleHeight =
3885
ScaleWidth =
4680
StartUpPosition = 3 '¨t²Î¹w³]È
Begin VB.TextBox Text3
Height
= 495
Left
= 3240
TabIndex
= 5
Top
= 1680
Width
= 1215
End
Begin VB.TextBox Text2
Height
= 495
Left
= 3240
TabIndex
= 4
Top
= 600
Width
= 1215
End
Begin VB.CommandButton Command3
Caption
= "¦sÀÉ"
Height
= 495
Left
= 3360
TabIndex
= 3
Top
= 3240
Width
= 1215
End
Begin VB.CommandButton Command2
Caption
= "¨ú¥N"
Height
= 495
Left
= 1800
TabIndex
= 2
Top
= 3240
Width
= 1335
End
Begin VB.CommandButton Command1
Caption
= "¶}ÀÉ"
Height
= 495
Left
= 240
TabIndex
= 1
Top
= 3240
Width
= 1335
End
Begin VB.TextBox Text1
Height
= 2895
Left
= 120
MultiLine
= -1 'True
ScrollBars
= 2 '««ª½±²¶b
TabIndex
= 0
Top
= 120
Width
= 2895
End
Begin VB.Label Label2
Caption
= "¨ú¥N¦r¦ê"
Height
= 375
Left
= 3240
TabIndex
= 7
Top
= 1200
Width
= 1215
End
Begin VB.Label Label1
Caption
= "·j´M¦r¦ê"
Height
= 375
Left
= 3240
TabIndex
= 6
Top
= 120
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
'TextSearch ¬°¦Û¦æÃä¼g¤§ Sub Procedure
'varObject ¬O¶Ç¤Jªº Textbox ª«¥ó
'OrgString ¬O´M§ä¦r¦ê
'RepString ¬O¨ú¥N¦r¦ê
Sub TextSearch(ByVal varObject As Control, _
ByVal OrgString As
String, _
ByVal RepString As
String)
Static varStart As Long '«Å§i Static
«¬ºA¡A¥Nªí¥¦¯à°O¦í¤W¦¸ªº·j´M¦ì¸m
Dim SeString As String
Dim NowPos As Long
'ª«¥ó±µ¦¬¾nÂI
varObject.SetFocus
'§â¤W¦¸¥¼·j´M¨ìªº¦r¦ê©ñ¤J SeString
ÅܼƤ¤
SeString = Right(varObject.Text, Len(varObject.Text)
- varStart)
'§ä·sªº²Å¦X¦r¦ê
NowPos = InStr(SeString, OrgString)
'¨S§ä¨ì
If NowPos = 0 Then
'°O¿ý«ü¼ÐÂk 0
varStart = 0
'³]©wµL¿ï¨ú
varObject.SelLength =
0
'§ä¨ì¤F
Else
'°O¿ý«ü¼Ð²¾¨ì·s¦ì¸m
varStart = varStart +
NowPos - 1
'±q°O¿ý«ü¼Ð¦ì¸m¶}©l¿ï¨ú
varObject.SelStart =
varStart
'¿ï¨ú·j´M¦r¦êªø«×
varObject.SelLength =
Len(OrgString)
'·j´M¦r¦ê´«¦¨·s¦r¦ê
varObject.SelText =
RepString
'°O¿ý«ü¼Ð²¾©¹¨ú¥N¦r¦ê¤§«á
varStart = varStart +
Len(RepString)
End If
End Sub
'¶}±Ò¬J¦s¤å¦rÀÉ
Private Sub Command1_Click()
Dim OpenString As String
Dim FHandle As Long
'§ä¤@Ó¥¼¨Ï¥ÎªºÀÉ®×¥N½X
FHandle = FreeFile()
'®ø°£ Textbox ùتºì¤å¦r
Text1.Text = ""
'¶}±Ò¤@¿é¤JÀÉ
Open "c:\ttt.txt" For Input As #FHandle
'§âÀÉ®×¥[¨ì Text1.Text ¤¤
Do While Not EOF(FHandle)
Line Input #FHandle,
OpenString
Text1.Text = Text1.Text
+ OpenString + Chr(13) + Chr(10)
Loop
Close #FHandle
End Sub
'©I¥s TextSearch °Æµ{§Ç
Private Sub Command2_Click()
TextSearch Text1, Text2.Text, Text3.Text
End Sub
'±N Text1.Text ¦s¦¨ÀÉ®×
Private Sub Command3_Click()
Dim FHandle As Long
FHandle = FreeFile()
Open "c:\ttt.txt" For Output As #FHandle
Print #FHandle, Text1.Text
Close #FHandle
End Sub
Rose ¼¶¼g©ó¤å³¹
Day(DateSerial(¦~¤À,(¤ë¥÷+1),0))
¦Ñ©Ç¸Ñ»¡¡G
¦Ñ©Ç¸Õ§@¡G
VERSION 5.00
Begin VB.Form Form1
Caption
= "Marquee"
ClientHeight = 3960
ClientLeft =
60
ClientTop =
345
ClientWidth =
4680
LinkTopic =
"Form1"
ScaleHeight =
3960
ScaleWidth =
4680
StartUpPosition = 3 '¨t²Î¹w³]È
Begin VB.CommandButton Command2
Cancel
= -1 'True
Caption
= "¶]°¨¿Oµ²§ô"
Height
= 495
Left
= 2640
TabIndex
= 5
Top
= 3360
Width
= 1215
End
Begin VB.Timer Timer1
Left
= 2160
Top
= 3480
End
Begin VB.CommandButton Command1
Caption
= "¶]°¨¿O¶}©l"
Height
= 495
Left
= 840
TabIndex
= 2
Top
= 3360
Width
= 1215
End
Begin VB.TextBox Text2
Height
= 1215
Left
= 840
MultiLine
= -1 'True
ScrollBars
= 2 '««ª½±²¶b
TabIndex
= 1
Top
= 1920
Width
= 3135
End
Begin VB.TextBox Text1
BackColor
= &H80000018&
Height
= 375
Left
= 1200
TabIndex
= 0
Top
= 360
Width
= 2895
End
Begin VB.Label Label4
Alignment
= 2 '¾a¤¤¹ï»ô
Caption
= "½Ð¿é¤J¶]°¨¿O¤å¦r"
Height
= 375
Left
= 1320
TabIndex
= 4
Top
= 1200
Width
= 2295
End
Begin VB.Label Label2
Caption
= "Text ¶]°¨¿O"
Height
= 375
Left
= 120
TabIndex
= 3
Top
= 360
Width
= 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'«Å§in¦b Text1 ùØÅã¥Üªº¶]°¨¿O¦r¦êÅܼÆ
Dim TString As String
Private Sub Command1_Click()
'«Å§iÀx¦s Text1 ¦r¦êªø«×ªºÅܼÆ
Dim TWidth As Long
Command2.Enabled = True
'±Ò°Ê Timer Åã¥Ü¶]°¨¿O
Timer1.Enabled = True
Command1.Enabled = False
'text2 ùØ¥²¶·¿é¤J¶]°¨¿O¦r¦ê
If Text2.Text = "" Then
MsgBox "½Ð¿é¤J¶]°¨¿O¤å¦r"
'¨S¦³¿é¤J´N«ö¤U
Command2 ¶]°¨¿Oµ²§ô¶s
Command2_Click
Exit Sub
End If
'²Îp Text1Box ùب쩳©ñªº¤U´XÓ¦r
Do While TextWidth(Space(TWidth)) <= Text1.Width
TWidth = TWidth + 1
Loop
'³]©w¶]°¨¿O¦r¦ê¬° Text1
¼e«×ӪťÕ
'¥[ì¿é¤Jªº ¶]°¨¿O¤å¦r
TString = Space(TWidth) + Text2.Text
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Command1.Enabled = True
Command2.Enabled = False
'Ãö³¬¶]°¨¿OÅã¥Ü
Timer1.Enabled = False
Text2.SetFocus
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 200
Command2.Enabled = False
'±N¦U¤¸¥ó Font
²Î¤@¡A§Q©ópºâ¦r¦ê¼e«×
Text1.Font = Me.Font
Text2.Font = Me.Font
Me.Show
Text2.SetFocus
End Sub
Private Sub Timer1_Timer()
'¶}©l¾e¨ú¶]°¨¿O¦r¦ê¤§¦ì¸m«ü¼Ð
Static TPos As Long
'¦pªG¦ì¸m«ü¼Ð¶V¹L¤F¾ãÓ¦r¦ê
If TPos > Len(TString) Then
'§â¦ì¸m«ü¼Ð²¾¨ì³Ì¶}ÀY
TPos = 1
Else
'§â¦ì¸m«ü¼Ð²¾¨ì¤U¤@Ó¦r
TPos = TPos + 1
End If
'³v¦rÅã¥Ü¶]°¨¿O¦r¦ê
Text1.Text = Mid(TString, TPos)
End Sub
³½¥b ¼¶¼g©ó¤å³¹
½Ð°ÝVB5¬O¥Îshell¨Ó°õ¦æ¥~³¡ÀÉ®×,¨º°õ¦æ«á,n«ç¼Ë¥ÎVBªº»yªk¨Ó²×¤î¦¹Àɮתº°õ¦æ©O!?
¦Ñ©Çµª¡G
Dim FHandle As Variant '(Àx¦sµøµ¡¥N½XªºÅܼÆ
Private Sub Command1_Click()
FHandle = Shell("C:\WIND98\CALC.EXE",
1) '(¶}±Ò¥~³¡°õ¦æÀÉ)
End Sub
Private Sub Command2_Click()
AppActivate FHandle 'Åý¥ý«e¶}±Òªºµøµ¡¨ú±oµJÂI¡C
SendKeys "%{f4}", True '°e¥X [Alt]+[F4]
Windows ¨t²ÎªºÃö³¬²Õ¦XÁä¡C
End Sub
§ï¼g¦¨¯à³B²z¿ù»~ªº©I¥s¨ç¼Æ«h¦p¤U¡G
¶}±Ò Windows À³¥Îµ{¦¡
'varAppName ¬Oµ{¦¡¸ô®|¤Î¦WºÙ¤§¶Ç»¼°Ñ¼Æ
'varWinState ¬OÀ³¥Îµ{¦¡µøµ¡¶}±Òª¬ºA,³]©w¤è¦¡½Ð°Ñ¦Ò
Shell
'ªº WindowsStyle »¡©ú
Private Function OpenApp(ByVal varAppName As String, _
Optional ByVal
varWinState As Integer)
'¶Ç¦^À³¥Îµ{¦¡¤§µøµ¡¥N½X
Dim varWinTitle As Variant
'¿ù»~³B²z
On Error GoTo OpenAppErr
varWinTitle = Shell(varAppName, varWinState)
OpenApp = varWinTitle
Exit Function
OpenAppErr:
Select Case Err.Number
Case 53
MsgBox "µ{¦¡¸ô®|©Î¦WºÙ¿ù»~", vbOKOnly, "¶}±ÒÀ³¥Îµ{¦¡"
End Select
End Function
'Ãö³¬ Windows À³¥Îµ{¦¡
'varWinTitle ¬O¶}±Òµ{¦¡®É Windows ¨t²Îµ¹ªº¥N½X
Private Sub CloseApp(ByVal varWinTitle As Variant)
'¿ù»~³B²z
On Error GoTo CloseAppErr
AppActivate varWinTitle
'¥Î SendKeys ³¯z¼ÒÀÀÁä½L [ALT]+[F4]
SendKeys "%{F4}"
Exit Sub
CloseAppErr:
Select Case Err.Number
Case 5
MsgBox "µ{¦¡µøµ¡¤w³QÃö³¬", vbOKOnly, "Ãö³¬À³¥Îµ{¦¡"
End Select
End Sub
'¤W±¬O§ï¼g Shell ©M AppActivate
ªº¨âÓ¨ç¼Æ¡A©I¥s¤è¦¡¦p¤U¡G
'«Å§i¤@ÓÀx¦sµøµ¡¥N½XªºÅܼÆ
Private WinTitle As Variant
'¶}µ{¦¡
Private Sub Command1_Click()
Dim AppName As String
AppName = "§Aªºµ{¦¡¸ô®|¤Î¦WºÙ"
WinTitle = OpenApp(AppName)
End Sub
'Ãöµ{¦¡
Private Sub Command2_Click()
CloseApp WinTitle
End Sub
º¡¨¬²{ªp...:P ¼¶¼g©ó¤å³¹
¤@Ó string ¤¤¦³ 'aaa bbb ccc' «ç»òÅý¥¦Åܦ¨ 'aaabbbccc'©O?
¦Ñ©Çµª¡G
Function KillChar(ByVal ExpString As String, ByVal KillString
As String)
Dim ReturnString As String
Dim I As Long
For I = 1 To Len(ExpString)
If Mid(ExpString, I, 1)
<> KillString Then
ReturnString = ReturnString + Mid(ExpString, I, 1)
End If
Next
KillChar = ReturnString
End Function
Private Sub Command1_Click()
Dim SomeChar As String
SomeChar = "aaa bbb
ccc"
Debug.Print SomeChar
SomeChar = KillChar(SomeChar, " ")
Debug.Print SomeChar
End Sub
¥Áô ¼¶¼g©ó¤å³¹
When dragmode set auto ©ì¦²picture®É,·|Åã²{¤@ӮخØ,·Pı¤£¦n, ©Ò¥H¥h³]dragicon, ¦ý¦o¥u±µ¨ü *.ico *.cur ½Ð°Ý¦pªG§Ún©ì¦²¤@Ó *.bmp picture, ©ì¦²´Á¶¡¤]nÅã¥Ü³oÓ bmp picture «ç»ò¿ì?
¦Ñ©Çµª¡G
¦pªG©ì¦²´Á¶¡¤]nÅã¥Ü Bmp Picture ¡A§A¥²¶·¨Ï Dragmode ¤´ºû«ù¤â°Ê¡AµM«á¨Ï¥ÎObject.Drag vbBeginDrag ªº¤èªk¥h±Ò°Ê¤@Ó Object ªº Drag µ{§Ç(ª`·N¡A¤£¯à¦b Form ªº Dragover_Event ùس]©w Object.Drag vbBeginDrag ¡A¦]¬°°£«D§A¥ý Object.Drag vbBeginDrag ¡A§_«h Form_Dragover ¸ò¥»¤£·|µo¥Í¡C) ¥H¤U¬O²³æªºµ{¦¡½X¡A§A¥i¥H°Ñ¦Ò¬Ý¬Ý¡C
Dim OldX As Single, OldY As Single
Private Sub Form_DragOver(Source As Control, X As Single, Y As
Single, State As Integer)
Source.Move Source.Left + X - OldX, Source.Top + Y - OldY
OldX = X
OldY = Y
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
Image1.Drag vbBeginDrag
OldX = Image1.Left + X
OldY = Image1.Top + Y
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X
As Single, Y As Single)
Image1.Drag vbEndDrag
End Sub
¡°¦Ñ©Ç½d¨Ò¤»¹ï©ó§ó¶¶ºZªº©ì¦²¹Ï¤ù¡A¦³§ó¦nªº¸Ñ¨M¤è®×¡A½Ð°Ñ¦Ò¡C¡°
¥Áô ¼¶¼g©ó¤å³¹
¥H Object.Drag vbBeginDrag ´N¥i¥H¦Û°Ê©ì¦² Object.Picture¡A¦ý¬°¤°»ò¤£¦b MouseMove_Event ùس]©w Object.Move X,Y (¦ý¤ñ¸û¤£¶¶ºZ,¤£ª¾¹D¯à¤£¯à§ïµ½?) ½Ð°Ý¥Î³o¨âºØ¤èªk¦³®É»ò§Q¹ú?
¦Ñ©Çµª¡G
¡°¦Ñ©Ç½d¨Ò¤»¹ï©ó§ó¶¶ºZªº©ì¦²¹Ï¤ù¡A¦³§ó¦nªº¸Ñ¨M¤è®×¡A½Ð°Ñ¦Ò¡C¡°
°ÆÀɦW |
¤j¤p¨î |
¦â¼Æ¤W |
¦V¶q©ÎÂI°} |
³z©ú®ÄªG |
¦sÀɮ榡 |
BMP | µL | ¥þ±m | ÂI°} | µL | BMP |
DIB | µL | ¥þ±m | ÂI°} | µL | DIB |
ICO | 32*32 | 16 | ÂI°} | ¦³ | ICO |
CUR | 32*32 | 2 | ÂI°} | ¦³ | CUR |
WMF | µL | ¥þ±m | ¦V¶q | ¦³ | WMF |
EMF | µL | ¥þ±m | ¦V¶q | ¦³ | EMF |
GIF | µL | 256 | ÂI°} | ¦³ | BMP |
JPG | µL | ¥þ±m | ÂI°} | µL | BMP |
¡°¦sÀɮ榡¬O«ü¥Î VB5 SavePicture ¦sÀɫ᪺Àɮ׮榡¡°
MetalFile ¡A´N¬O°ÆÀɦW WMF ©Î EMF ªº¦V¶q¹ÏÀÉ¡A¤]´N¬O¦b Office ùؼsªx±Ä¥Îªº¬ü¤u¹Ï®w¹Ï®×¡A¦³ÂI¯îÂÕªº¬O Office ¤Ñ¤Ñ¦b¥Î MetalFile¡A¥¦ªºÃ¸¹Ï¤u¨ãµe¥X¨Óªº¹Ï¤]¬O MetalFile¡A¥i´N¤£´£¨Ñ§â Office »s§@¥X¨Óªº¹Ï¦s¦¨ WMF Àɪº¥\¯à¡C³o¦b¨ä¥L¤£·| VB »y¨¥ªº·íµM¬OÃø¨Æ¤@¼Î¡A¦ý§A¥i¥H§Q¥ÎOffice ø¹Ï¤u¨ã§â¹Ïµe¦n¡A±N¥þ¹Ï¸s²Õ¤Æ«á¡A«ö½Æ»s¡A¦A¦b VB ¤¤°õ¦æ¥H¤Uªº»yªk¡A´N¥i¥H±o¨ì¿W¥ßªº WMF ¹Ï¦b VB ùØÀ³¥Î¡C
Private Sub Command1_Click()
If Clipboard.GetFormat(vbCFMetafile) Then
Set Picture1.Picture =
Clipboard.GetData
SavePicture Picture1.Picture,
"c:\test\bin.wmf"
End If
End Sub