⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 begin.bak

📁 不错的用电管理系统,用VFP6.0做的.大家可以下来看看哦
💻 BAK
字号:

*********************************************************
* 程序名称:用电管理系统 版本: 2002 主程序 (BEGIN.PRG) *
* 完成日期:2001年07月                                  *
* 程序设计:唐国春                                      *
* 工作单位:广西兴安县供电公司                       *
* 联系电话:(0)13807833358                              *
* 联系扩机:199(或)198-78083358               *
* 电子信箱:tanggc@sina.com                             *
*********************************************************

set defa to curdir()

do err_get

On key label F10
*On key label F10 do q
On shutdown do form exit

close database

set talk off
set status bar on
set clock on
set clock status

public sysbz,menushow,timebz,timebz1,tcbz,tjbz,fbl_w,fbl_h,helpbz,tm,top1,toolbz,form_num,tool_wz1,totalpages,czy
public err,err_program,err_line,err_info1

helpbz=0
timebz=0
timebz1=0
sysbz=0
menushow=1
tcbz=0
tjbz=0
toolbz=0
form_num=0
totalpages=0

fbl_w=SYSMETRIC(1)
fbl_h=SYSMETRIC(2)

sele 0
use time
time1=rq
tm=subs(rq,1,4)+'年'+subs(rq,5,2)+'月'
use in time

sele 0
use datapath
go top
datapath=sj_path
use in datapath

local ctitle
CT='用电管理系统 (2002标准版)'
ctitle=ct+space(2)+substr(time1,1,4)+'年'+substr(time1,5,2)+'月'
Declare integer FindWindow in win32api string cClass,String cCaption
if FindWindow(0,ctitle)#0
	_screen.windowstate=2
	_screen.caption=ctitle
	_screen.visible=.f.
	??chr(7)
	=messagebox("&ct 已经运行,请您看看下面的任务栏!",48,'警告!')
	on shutdown
	quit
endif

with _screen
	.autocenter=.t.
*	.alwaysontop=.t.
	.caption=ctitle
endwith

*****工具栏*******************************************
close database
do tbsave
clear

PUBL Toolbar
sele 0
	use run_cs
	tool_wz1=run_cs.tool_wz
use in run_cs
SET CLASS TO MY_TOOLBAR.VCX
Toolbar=CREATEOBJECT('MYTOOLBAR')
Toolbar.dock(tool_wz1)
Toolbar.Visible = .T.
Toolbar.SHOW
toolbz=1

with _screen
	.windowstate=1
	.visible=.f.
endwith

do form ver name ver1
read events

with _screen
	.visible=.t.
	.icon='ico\face2.ico'
	.maxbutton=.f.
	.minbutton=.f.
	.closable=.f.
	.caption=ct
	.backcolor=rgb(128,128,128)
*	.backcolor=rgb(0,48,140)
endwith

do begin.mpr

_screen.windowstate=2

if sysmetric(1)>=1024
	backimage1='pic\title_1024.jpg'
	top1=int((768-100-500)/2)
else
	if sysmetric(1)>=800
		backimage1='pic\title_800.jpg'
		top1=int((600-100-391)/2)
	else
		backimage1='pic\title_640.jpg'
		top1=int((480-100-313)/2)
	endif
endif

************************屏幕背景*********************

*_screen.picture="pic\bj.jpg"
_screen.picture="pic\bj1.gif"

_screen.addobject('backimage','image') &&在主窗口中加一个image对象backimage,并设置其各个属性
with _screen.backimage
	.picture=backimage1
	.top=top1
endwith
_screen.backimage.visible=.t.

sele 0
use gds
loca for bz='*'
if .not. found()
	go top
endif
dw1=allt(gds)
use in gds

dw_cd=int(len(dw1)/2)
xdw=''
for i=1 to dw_cd
	dq=substr(dw1,1+(i-1)*2,2)
	if i<>dw_cd
		xdw=xdw+chr(39)+dq+chr(39)+'+chr(13)+'
	else
		xdw=xdw+chr(39)+dq+chr(39)
	endif
endfor

***********************单位名称*******************

_screen.addobject('lbl1','label') &&在主窗口中加一个标签对象lbl1,并设置其各个属性
with _screen.lbl1
	.caption=&xdw &&设置内容
	.top=fbl_h/6+3 &&设置位置
	.left=fbl_w-fbl_w/8+2
	.height=300
	.width=50
	.forecolor=RGB(0,0,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontbold=.t.
	.fontsize=24
	.backstyle=0
endwith
_screen.addobject('lbl2','label')
with _screen.lbl2
	.caption=&xdw &&设置内容
	.top=fbl_h/6+2 &&设置位置
	.left=fbl_w-fbl_w/8+1
	.height=300
	.width=50
	.forecolor=RGB(0,128,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontbold=.t.
	.fontsize=24
	.backstyle=0
endwith
_screen.addobject('lbl3','label')
with _screen.lbl3
	.caption=&xdw &&设置内容
	.top=fbl_h/6 &&设置位置
	.left=fbl_w-fbl_w/8
	.height=300
	.width=50
	.forecolor=RGB(0,255,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontbold=.t.
	.fontsize=24
	.backstyle=0
endwith
_screen.lbl1.visible=.t.
_screen.lbl2.visible=.t.
_screen.lbl3.visible=.t.

*********************版权标志********************

top_ce=0 &&上下调整额

_screen.addobject('lbl4','label')
with _screen.lbl4
	.caption='本产品受版权法保护' &&设置内容
	.autosize=.t.
	.top=fbl_h-fbl_h/6+1+top_ce &&设置位置
	.left=fbl_w
	.forecolor=RGB(0,0,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontsize=11
	.backstyle=0
endwith
_screen.addobject('lbl5','label')
with _screen.lbl5
	.caption='本产品受版权法保护' &&设置内容
	.autosize=.t.
	.top=fbl_h-fbl_h/6+top_ce &&设置位置
	.left=fbl_w
	.forecolor=RGB(0,255,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontsize=11
	.backstyle=0
endwith
_screen.lbl4.visible=.t.
_screen.lbl5.visible=.t.
_screen.lbl4.left=int((fbl_w-_screen.lbl4.width)*0.618)+1
_screen.lbl5.left=int((fbl_w-_screen.lbl4.width)*0.618)
if sysmetric(1)>=1024
	top1=int((768-60-500)/2)+500-8+top_ce
else
	if sysmetric(1)>=800
		top1=int((600-60-391)/2)+391-8+top_ce
	else
		top1=int((480-60-313)/2)+313-8+top_ce
	endif
endif
_screen.lbl4.top=top1+1
_screen.lbl5.top=top1

_screen.addobject('shape1','shape')
with _screen.shape1
	.top=top1-2+1 &&设置位置
	.left=_screen.lbl4.left-7+1
	.height=_screen.lbl4.height
	.width=_screen.lbl4.width+9
	.bordercolor=RGB(0,0,0) &&设置框线色
	.backstyle=0
endwith
_screen.addobject('shape2','shape')
with _screen.shape2
	.top=top1-2 &&设置位置
	.left=_screen.lbl4.left-7
	.height=_screen.lbl4.height
	.width=_screen.lbl4.width+9
	.bordercolor=RGB(0,255,0) &&设置框线色
	.backstyle=0
endwith
_screen.shape1.visible=.t.
_screen.shape2.visible=.t.

*********************数据路径********************

_screen.addobject('mpath','label') &&数据路径显示
with _screen.mpath
	.caption="数据路径:"+allt(datapath)
	.autosize=.t.
	.top=fbl_h-fbl_h/6+1+top_ce &&设置位置
	.left=fbl_w
	.forecolor=RGB(0,0,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontsize=9
	.backstyle=0
endwith
_screen.addobject('mpath1','label') &&数据路径显示
with _screen.mpath1
	.caption=_screen.mpath.caption
	.autosize=.t.
	.top=fbl_h-fbl_h/6+1+top_ce &&设置位置
	.left=fbl_w
	.forecolor=RGB(0,255,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontsize=9
	.backstyle=0
endwith

with _screen
	.mpath.visible=.t.
	.mpath1.visible=.t.
	.mpath.left=int((fbl_w-.mpath.width))-20
	.mpath1.left=.mpath.left-1
	if sysmetric(1)>=1024
		top1=int((768-60-500)/3)+500-15+top_ce
	else
		if sysmetric(1)>=800
			top1=int((600-60-391)/3)+391-15+top_ce
		else
			top1=int((480-60-313)/3)+313-15+top_ce
		endif
	endif
	.mpath.top=top1+1
	.mpath1.top=top1
endwith

release datapath

*********************操作员********************

_screen.addobject('mczy','label')
with _screen.mczy
	.caption="操作员:XXX"
	.autosize=.t.
	.top=fbl_h-fbl_h/6+1+top_ce &&设置位置
	.left=fbl_w
	.forecolor=RGB(0,0,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontsize=9
	.backstyle=0
endwith
_screen.addobject('mczy1','label')
with _screen.mczy1
	.caption=_screen.mczy.caption
	.autosize=.t.
	.top=fbl_h-fbl_h/6+1+top_ce &&设置位置
	.left=fbl_w
	.forecolor=RGB(0,255,0) &&设置前景色
	.fontname='宋体' &&设置字体
	.fontsize=9
	.backstyle=0
endwith

************************************************

=INKEY(0.2,'m')

do jm.prg with 'password',0
do kl

=INKEY(0.01,'m')

do time.prg
close database

with _screen
	.minbutton=.t.
	.closable=.t.
endwith

read events

****************************************************************************************
PROCEDURE Q

	set sysm to defa
	on shutdown
	set status bar on
	do tbrest
	with _screen
		.minbutton=.t.
		.maxbutton=.t.
		.closable=.t.
		.icon=''
		.caption='Microsoft Visual Foxpro 6.0'
		.removeobject('lbl1')
		.removeobject('lbl2')
		.removeobject('lbl3')
		.removeobject('backimage')
		.removeobject('lbl4')
		.removeobject('lbl5')		
		.removeobject('shape1')
		.removeobject('shape2')
		.removeobject('mpath')
		.removeobject('mpath1')
		.removeobject('mczy')
		.removeobject('mczy1')
		.backcolor=rgb(255,255,255)
		.picture=""
	endwith
	clea all
	close database
	do jm with 'password',1	
	cancel
	return

endproc	

****************************************************************************************
PROCEDURE TBSAVE && 保存工具条

	PRIVATE TbGs,Gs
	Gs=11

	PUBLIC Tb[Gs,2]
	*DIMENSION Tb[Gs,2] &&定义二维数组

	Tb[1,1] ='调色板'
	Tb[2,1] ='数据库设计器'
	Tb[3,1] ='表单控件'
	Tb[4,1] ='表单设计器'
	Tb[5,1] ='布局'
	Tb[6,1] ='打印预览'
	Tb[7,1] ='查询设计器'
	Tb[8,1] ='报表控件'
	Tb[9,1] ='报表设计器'
	Tb[10,1]='常用'
	Tb[11,1]='视图设计器'

	FOR TbGs=1 TO Gs
		IF WEXIST(Tb(TbGs,1))
			Tb(TbGs,2)=.T.
			Hide Window(Tb(TbGs,1))
		ELSE
			Tb(TbGs,2)=.F.
		ENDIF
	ENDFOR

	RETURN

endproc

*****************************************************************************************
PROCEDURE TBREST && 恢复工具条

	PRIVATE TbGs

	FOR TbGs=1 TO ALEN(Tb,1)
		IF Tb(TbGs,2)
			Show WINDOW (Tb(TbGs,1))
		ENDIF
	ENDFOR

	RETURN

endproc

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -