【正文】
111幫助關(guān)于窗口 1. 應(yīng)用對(duì)象open 事件 // Profile mydb = ODBC = False = ConnectString=39。DSN=mydb。UID=dba。PWD=sql39。connect。if =0 then open(w_startup) else messagebox(,數(shù)據(jù)庫(kù)連接失敗) //連接數(shù)據(jù)庫(kù),成功就打開(kāi)w_startup窗口,否則提示失敗end if2. 登陸窗口的open事件=string(now(),hhmmss) //通過(guò)時(shí)間計(jì)算得到驗(yàn)證碼登陸窗口確定按鈕clicked事件int bstring username,passwordusername=password=select count(*) into :b from myuser where userid=:username and password=:password。 //查詢(xún)出id 和passwordif b0 and = then //id、password、驗(yàn)證碼的比對(duì) open(w_main) close(w_login)else messagebox(,你的密碼或驗(yàn)證碼有錯(cuò),請(qǐng)重新輸入!)end ifselect rank into :qx from myuser where userid=:username and password=:password。 //取得權(quán)限的代號(hào)3. 主窗口open事件opensheet(w_logo,w_main)timer(1)timer事件 //取得系統(tǒng)時(shí)間 并在標(biāo)題顯示時(shí)間和權(quán)限的簡(jiǎn)單說(shuō)明if qx=2 thentitle=(學(xué)生成績(jī)管理系統(tǒng) 當(dāng)前時(shí)間:+string(now(),hh:mm:ss)+ 您的權(quán)限是:學(xué)生您只能查詢(xún)) end if if qx=1 thentitle=(學(xué)生成績(jī)管理系統(tǒng) 當(dāng)前時(shí)間:+string(now(),hh:mm:ss)+ 您的權(quán)限是:教師您能查詢(xún),修改) end if if qx=0 thentitle=(學(xué)生成績(jī)管理系統(tǒng) 當(dāng)前時(shí)間:+string(now(),hh:mm:ss)+ 您的權(quán)限是:管理員)end ifrbuttondown事件(xpos,ypos) //右擊事件中關(guān)聯(lián)菜單resize事件if isvalid(w_logo) then = +800 = +230end if if = then =modified end if 4. 成績(jī)查詢(xún)窗口open事件(sqlca)()關(guān)閉按鈕clickedclose(w_cjicx)查找按鈕 clicked=3067long frowstring fstropenwithparm(w_find,student) //打開(kāi)窗口并提交一個(gè)值fstr=(fstr)()5.查找窗口的open事件choose case case student (學(xué)號(hào) *studentid) (姓名 *name)end choose查找窗口中的確定按鈕clickedint nstring rcif = then messagebox(提示,沒(méi)有設(shè)置查找條件!請(qǐng)輸入。,exclamation!,ok!) () returnend if n=pos(,39。*39。)rc=right(,len()n)rc += + + rc += 39。 + + 39。 closewithreturn(parent,rc) (sqlca)()=2971=1684if qx=2 or qx=0 then //根據(jù)登陸的帳號(hào)給于不同的權(quán)限,可以或不可以使用某個(gè)按扭=fal