资源描述:
《vb使用技巧三(vb using skills three)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、vb使用技巧三(VBusingskillsthree)Author:whiteDate:99-6-3p.m.07:53:57TurntheVBstandardtoolbarintoaflattypeTheflattoolbarseemscool!ButtheVB5providesonlyplainraisedtoolbars.Doyouwanttoturnitintoaflatsurface?Itdoesn'tseemeasy.Butthat'snotthecase.Tryit:BAS:Public,Const,
2、WM_USER=&H400Public,Const,TB_SETSTYLE=WM_USER+56Public,Const,TB_GETSTYLE=WM_USER+57Public,Const,TBSTYLE_FLAT=&H800PublicDeclareFunctionSendMessageLongLib"user32"Alias"SendMessageA"_ByVal(hWndAsLong,_ByValwMsgAsLong,_ByValwParamAsLong,_ByVal,lParam,As,Long)AsL
3、ongPublicDeclareFunctionFindWindowExLib"user32"Alias"FindWindowExA"_ByVal(hWnd1AsLong,_ByValhWnd2AsLong,_ByVallpsz1AsString,_ByVal,lpsz2,As,String)AsLongSUB:Private,Sub,MakeFlat()DimstyleAsLongDimhToolbarAsLongDimRAsLongHToolbar=FindWindowEx(Toolbar1.hwnd,0&,
4、ToolbarWindow32,vbNullString)Style=SendMessageLong(hToolbar,TB_GETSTYLE,0&,0&)If,style,And,TBSTYLE_FLAT,ThenStyle=style,Xor,TBSTYLE_FLATElse:style=style,Or,TBSTYLE_FLATEndIfR=SendMessageLong(hToolbar,TB_SETSTYLE,0,style)Toolbar1.RefreshEndSubNote:4.70ormoreve
5、rsionsofcomctl32.dllsupportarerequired.--------------------------------------------------------------------------------Display&symbolinCaptionAsyouknow,&thesymbolistheshortcutkeynotationforWindows,andifyouwanttodisplayitinCaption&themethodissimple,youcanenter
6、twosymbolsconsecutively.IftheinputSaveandExitinCaption,Save&Exitshow.[returnskillsindex]--------------------------------------------------------------------------------KeepthewindowupallthetimeManypopularsoftwarehassuchanoption:Always,on,Top.Itallowsthewindow
7、totopandotherwindowsnottooverwriteit.WecandothisinVBusingthefollowingmethods:Private,Const,SWP_NOSIZE=&H1Private,Const,SWP_NOMOVE=&H2Private,Const,SWP_NOZORDER=&H4Private,Const,SWP_NOREDRAW=&H8Private,Const,SWP_NOACTIVATE=&H10Private,Const,SWP_FRAMECHANGED=&H
8、20Private,Const,SWP_SHOWWINDOW=&H40Private,Const,SWP_NOCOPYBITS=&H80Private,Const,SWP_NOOWNERZORDER=&H200Private,Const,SWP_DRAWFRAME=SWP_FRAMECHANGEDPrivate,Const,SWP_NOREPOSITION=SWP_NOO