|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
专业性的服务。有的ASP商提供垂直型的应用服务,针对某一特定行业提供应用服务。MsgBoxFunction
Displaysamessageinadialogbox,waitsfortheusertoclickabutton,andreturnsavalueindicatingwhichbuttontheuserclicked.
MsgBox(prompt[,buttons][,title][,helpfile,context])
Arguments
prompt
Stringexpressiondisplayedasthemessageinthedialogbox.Themaximumlengthofpromptisapproximately1024characters,dependingonthewidthofthecharactersused.Ifpromptconsistsofmorethanoneline,youcanseparatethelinesusingacarriagereturncharacter(Chr(13)),alinefeedcharacter(Chr(10)),orcarriagereturnClinefeedcharactercombination(Chr(13)&Chr(10))betweeneachline.
buttons
Numericexpressionthatisthesumofvaluesspecifyingthenumberandtypeofbuttonstodisplay,theiconstyletouse,theidentityofthedefaultbutton,andthemodalityofthemessagebox.SeeSettingssectionforvalues.Ifomitted,thedefaultvalueforbuttonsis0.
title
Stringexpressiondisplayedinthetitlebarofthedialogbox.Ifyouomittitle,theapplicationnameisplacedinthetitlebar.
helpfile
StringexpressionthatidentifiestheHelpfiletousetoprovidecontext-sensitiveHelpforthedialogbox.Ifhelpfileisprovided,contextmustalsobeprovided.Notavailableon16-bitplatforms.
context
NumericexpressionthatidentifiestheHelpcontextnumberassignedbytheHelpauthortotheappropriateHelptopic.Ifcontextisprovided,helpfilemustalsobeprovided.Notavailableon16-bitplatforms.
Settings
Thebuttonsargumentsettingsare:
ConstantValueDescription
vbOKOnly0DisplayOKbuttononly.
vbOKCancel1DisplayOKandCancelbuttons.
vbAbortRetryIgnore2DisplayAbort,Retry,andIgnorebuttons.
vbYesNoCancel3DisplayYes,No,andCancelbuttons.
vbYesNo4DisplayYesandNobuttons.
vbRetryCancel5DisplayRetryandCancelbuttons.
vbCritical16DisplayCriticalMessageicon.
vbQuestion32DisplayWarningQueryicon.
vbExclamation48DisplayWarningMessageicon.
vbInformation64DisplayInformationMessageicon.
vbDefaultButton10Firstbuttonisdefault.
vbDefaultButton2256Secondbuttonisdefault.
vbDefaultButton3512Thirdbuttonisdefault.
vbDefaultButton4768Fourthbuttonisdefault.
vbApplicationModal0Applicationmodal;theusermustrespondtothemessageboxbeforecontinuingworkinthecurrentapplication.
vbSystemModal4096Systemmodal;allapplicationsaresuspendeduntiltheuserrespondstothemessagebox.
Thefirstgroupofvalues(0C5)describesthenumberandtypeofbuttonsdisplayedinthedialogbox;thesecondgroup(16,32,48,64)describestheiconstyle;thethirdgroup(0,256,512,768)determineswhichbuttonisthedefault;andthefourthgroup(0,4096)determinesthemodalityofthemessagebox.Whenaddingnumberstocreateafinalvaluefortheargumentbuttons,useonlyonenumberfromeachgroup.
ReturnValues
TheMsgBoxfunctionhasthefollowingreturnvalues:
ConstantValueButton
vbOK1OK
vbCancel2Cancel
vbAbort3Abort
vbRetry4Retry
vbIgnore5Ignore
vbYes6Yes
vbNo7No
Remarks
Whenbothhelpfileandcontextareprovided,theusercanpressF1toviewtheHelptopiccorrespondingtothecontext.
IfthedialogboxdisplaysaCancelbutton,pressingtheESCkeyhasthesameeffectasclickingCancel.IfthedialogboxcontainsaHelpbutton,context-sensitiveHelpisprovidedforthedialogbox.However,novalueisreturneduntiloneoftheotherbuttonsisclicked.
WhentheMsgBoxfunctionisusedwithMicrosoftInternetExplorer,thetitleofanydialogpresentedalwayscontains"VBScript:"todifferentiateitfromstandardsystemdialogs.
ThefollowingexampleusestheMsgBoxfunctiontodisplayamessageboxandreturnavaluedescribingwhichbuttonwasclicked:
DimMyVar
MyVar=MsgBox("HelloWorld!",65,"MsgBoxExample")
MyVarcontainseither1or2,dependingonwhichbuttonisclicked.
Requirements
</p>ASP是依赖组件的,能访问数据库的组件好多就有好多种,再有就是你微软的工具可是什么都要收钱的啊! |
|