mdi窗口加背景图片

这篇博客介绍如何在MDI窗口中添加背景图片,通过定义窗口类型、使用特定库函数`LHT_SetBmp`和`LHT_DelBmp`,并在窗口的创建、销毁、打开、调整大小等事件中处理图片的加载和位置更新。示例代码展示了如何创建窗口、子窗口以及按钮,并设置背景图片为'D:/exerise/超级漂亮的日历控件源码/calendarBack.bmp'。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

forward
global type w_abc from window
end type
type mdi_1 from mdiclient within w_abc
end type
type p_1 from picture within w_abc
end type
type cb_1 from commandbutton within w_abc
end type
end forward

global type w_abc from window
integer width = 2533
integer height = 1408
boolean titlebar = true
string title = "Untitled"
string menuname = "et"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
windowtype windowtype = mdihelp!
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
mdi_1 mdi_1
p_1 p_1
cb_1 cb_1
end type
global w_abc w_abc

type prototypes
subroutine LHT_SetBmp( long mdiclient, ref string abmp, boolean originalsize) library 'LHT_mdibmp.dll'
subroutine LHT_DelBmp( long mdiclient ) library 'lht_mdibmp.dll'

end prototypes
on w_abc.create
if this.MenuName = "et" then this.MenuID = create et
this.mdi_1=create mdi_1
this.p_1=create p_1
this.cb_1=create cb_1
this.Control[]={this.mdi_1,&
this.p_1,&
this.cb_1}
end on

on w_abc.destroy
if IsValid(MenuID) then destroy(MenuID)
destroy(this.mdi_1)
destroy(this.p_1)
destroy(this.cb_1)
end on

event open;cb_1.x=0
cb_1.y=0
string ls_bmp='D:/exerise/超级漂亮的日历控件源码/calendarBack.bmp'
LHT_SetBmp( handle( mdi_1 ),ls_bmp, true )
mdi_1.x=cb_1.width
mdi_1.y=cb_1.height
mdi_1.width=this.workspacewidth( ) - cb_1.width
mdi_1.height=this.workspaceheight() - cb_1.height

end event

event resize;this.setredraw( false)
mdi_1.width=this.workspacewidth( ) - cb_1.width
mdi_1.height=this.workspaceheight() - cb_1.height
//p_1.width=mdi_1.width - 20
//p_1.height=mdi_1.height - 20
//p_1.x=mdi_1.x+10
//p_1.y=mdi_1.y+10
//
this.setredraw(true)

end event

event close;LHT_DelBmp( handle( mdi_1 ) )
end event

type mdi_1 from mdiclient within w_abc
long BackColor=268435456
end type

type p_1 from picture within w_abc
integer x = 50
integer y = 24
integer width = 101
integer height = 92
string picturename = "D:/exerise/超级漂亮的日历控件源码/calendarBack.bmp"
boolean focusrectangle = false
end type

type cb_1 from commandbutton within w_abc
integer x = 18
integer y = 12
integer width = 210
integer height = 164
integer taborder = 10
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "none"
end type

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值