1、为树状浏览器控件添加节点和子节点
用ADD方法添加一个新节点到树状浏览器的NODES集合时,可以声明它是和已存在的节点所联系起来的public List selectList(String statement, Object parameter, RowBounds rowBounds) {[1, -4, 3]方法一:
PublicFunctionFastReplace(SSrch$,SFind$,SRepl$)AsString
DimSrc()AsByte,Dst()AsByte,R()AsByte,F()AsByte
DimLenF&,LenR&,LenDst&,i&,j&,OutPos&
ConstChunkSize&=4096
IfSSrch=""OrSFind=""ThenExitFunction
Src=SSrch:F=SFind:R=SRepl
LenF=UBound(F):LenR=UBound(R)
LenDst=ChunkSize:ReDimDst(0ToLenDst-1)
Fori=0ToUBound(Src)Step2
Forj=0ToLenFStep2
IfSrc(i j)<>F(j)ThenExitFor
Nextj
Ifj>LenFThen'Found
Forj=0ToLenRStep2
IfOutPos>=LenDstThen
LenDst=LenDst ChunkSize
ReDimPreserveDst(0ToLenDst)
EndIf
Dst(OutPos)=R(j):OutPos=OutPos 2
Nextj
i=i LenF-1
Else
IfOutPos>=LenDstThen
LenDst=LenDst ChunkSize
ReDimPreserveDst(0ToLenDst)
EndIf
Dst(OutPos)=Src(i):OutPos=OutPos 2
EndIf
Nexti
ReDimPreserveDst(0ToOutPos-2):SSrch=Dst
FastReplace=SSrch$
EndFunction
方法二:
'SearchLineisinput,SearchForiswhattosearchfor,ReplaceWithisthereplacement
FunctionsReplace(SearchLineAsString,SearchForAsString,ReplaceWithAsString)
DimvSearchLineAsString,foundAsInteger
found=InStr(SearchLine,SearchFor):vSearchLine=SearchLine
Iffound<>0Then
vSearchLine=""
Iffound>1ThenvSearchLine=Left(SearchLine,found-1)
vSearchLine=vSearchLine ReplaceWith
Iffound Len(SearchFor)-1
vSearchLine=vSearchLine Right$(SearchLine,Len(SearchLine)-found-Len(SearchFor) 1)
EndIf
sReplace=vSearchLine
EndFunction->
PublicDeclareFunctionGetDesktopWindowLib"user32"()AsLong
PublicDeclareFunctionGetDCLib"user32"(ByValhwndAsLong)AsLong
PublicDeclareFunctionBitBltLib"gdi32"_
(ByValhDestDCAsLong,_
ByValxAsLong,_
ByValyAsLong,_
ByValnWidthAsLong,_
ByValnHeightAsLong,_
ByValhSrcDCAsLong,_
ByValxSrcAsLong,_
ByValySrcAsLong,_
ByValdwRopAsLong)AsLong
PrivateSubForm_Load()
DimlDesktopAsLong
DimlDCAsLong
Form1.AutoRedraw=True
Form1.ScaleMode=1
lDesktop=GetDesktopWindow()'取得桌面窗口
lDC=GetDC(lDesktop)'取得桌面窗口的设备场景
BitBltMe.hDC,0,0,Screen.Width,Screen.Height,lDC,0,0,vbSrcCopy'将桌面图象绘制到窗体
EndSub->
FunctionCheckSpell(IncorrectTextasstring)asstring
DimWordAsObject,retText$
OnErrorResumeNext
'建立对象并打开WORD
SetWord=CreateObject("Word.Basic")
'把需要检查的STRING放到WORD
Word.AppShow
Word.FileNew
Word.InsertIncorrectText
'运行WORD拼写检查
Word.ToolsSpelling
Word.EditSelectAll
'取返回值
retText=Word.Selection$()
CheckSpell=Left$(retText,Len(retText)-1)
'关闭文件并回到VB应用
Word.FileClose2
Show
SetWord=Nothing
EndFunction->
当前页面发生原因有时候您会同时写几个不同的程序,或因为某种原因,程序停了一段时间,当您下一次要再继续写时,已经忘了上次写到那里了,其实有一个很简单的方法,可以马上唤起您的记忆且窗口对菜单的生命周期负责,只有在窗口创建之后,菜单才能够创建,菜单必须在窗口销毁之前销毁。