Using OpenUserObject loading the custom controls in your program
If NOT isvalid (uo_wlzb) then
Uo_wlzb=create uo_manager_wlzb
Enclosing OpenUserObject (uo_wlzb, "uo_wlzb uo_bl. X, uo_bl. Y)
SetParent (Handle (uo_wlzb), Handle (THIS))
Uo_wlzb. Width=uo_bl. Width
Uo_wlzb. Height=uo_bl. Height
Uo_wlzb. Wf_resize (uo_wlzb. Width, uo_wlzb. Height)
End the if
Uo_wlzb. Visible=true
In a BUTTON by closeuserobject uninstall
If isvalid (uo_wlzb) then
Destroy uo_wlzb
The parent. Closeuserobject (uo_wlzb)
END the IF
But not clean, there are interface, just click on the interface of the program will automatically exit, if again to reload the program also can exit the
Excuse me expert door, loading and unloading of custom controls how to control, can't use, into the way of control with process control,
Please welcome!
CodePudding user response:
if isvalid (uo_wlzb) then
//destroy uo_wlzb it remove
The parent. Closeuserobject (uo_wlzb)
END the IF
CodePudding user response:
Ha ha, get rid of destroy uo_wlzb useless ah, I've tried,CodePudding user response:
How uo_wlzb definitionThe following two objects into (new) PBL try
Uo_manager_wlzb. Sru
$PBExportHeader $uo_manager_wlzb. Sru
Forward
Global type uo_manager_wlzb from userobject
End type
Type cb_1 from commandbutton within uo_manager_wlzb
End type
End forward
Global type uo_manager_wlzb from userobject
The integer width=571
The integer height=600
Boolean border=true
Long backcolor=67108864
String text="none"
Long tabtextcolor=33554432
Long picturemaskcolor=536870912
Cb_1 cb_1
End type
Global uo_manager_wlzb uo_manager_wlzb
On uo_manager_wlzb. The create
Enclosing cb_1=create cb_1
This. The Control []={this. Cb_1}
End on
On uo_manager_wlzb. Destroy
Destroy (enclosing cb_1)
End on
Type cb_1 from commandbutton within uo_manager_wlzb
The integer x=87
The integer y=128
The integer width=457
The integer height=128
The integer taborder=10
The integer textsize=- 12
The integer weight=400
Fontcharset fontcharset=ANSI!
Fontpitch fontpitch=variable!
Fontfamily fontfamily=Swiss!
String facename="Arial"
String text="none"
End type
W_main1. SRW
$PBExportHeader $w_main1. SRW
Forward
Global type w_main1 from window
End type
Type cb_3 from commandbutton within w_main1
End type
Type st_2 from statictext within w_main1
End type
Type ddplb_1 from dropdownpicturelistbox within w_main1
End type
End forward
Global type w_main1 from window
The integer width=2126
The integer height=1264
Boolean titlebar=true
String title="service instance"
Boolean controlmenu=true
Boolean minbox=true
Boolean maxbox=true
Boolean the resizable=true
Long backcolor=67108864
String icon="AppIcon!"
Boolean center=true
Cb_3 cb_3
St_2 st_2
Ddplb_1 ddplb_1
End type
Global w_main1 w_main1
The type as
The Function Long SetParent (Long childwin, Long parentwin) Library "user32. DLL
"End as
The type variables
Uo_manager_wlzb uo_wlzb
End the variables
On w_main1. The create
Enclosing cb_3=create cb_3
Enclosing st_2=create st_2
Enclosing ddplb_1=create ddplb_1
This. The Control []={this cb_3, & amp;
This st_2, & amp;
Enclosing ddplb_1}
End on
On w_main1. Destroy
Destroy (enclosing cb_3)
Destroy (enclosing st_2)
Destroy (enclosing ddplb_1)
End on
The event open;
If NOT isvalid (uo_wlzb) then
Uo_wlzb=create uo_manager_wlzb
Enclosing OpenUserObject (uo_wlzb, "uo_wlzb", 0, 0)
SetParent (Handle (uo_wlzb), Handle (THIS))
Uo_wlzb. Width=1233
Uo_wlzb. Height=333
End the if
Uo_wlzb. Visible=true
End the event
Type cb_3 from commandbutton within w_main1
The integer x=1326
The integer y=664
The integer width=457
The integer height=128
The integer taborder=30
The integer textsize=- 12
The integer weight=400
Fontcharset fontcharset=ANSI!
Fontpitch fontpitch=variable!
Fontfamily fontfamily=Swiss!
String facename="Arial"
String text="none"
End type
The event clicked; If isvalid (uo_wlzb) then
//destroy uo_wlzb
The parent. Closeuserobject (uo_wlzb)
END the IF
End the event
Type st_2 from statictext within w_main1
The integer x=114
The integer y=1308
The integer width=393
The integer height=60
The integer textsize=9
The integer weight=400
Fontcharset fontcharset=ANSI!
Fontpitch fontpitch=variable!
Fontfamily fontfamily=Swiss!
String facename="Arial"
Long textcolor=33554432
Long backcolor=67108864
A string of text=""
Boolean focusrectangle=false
End type
Type ddplb_1 from dropdownpicturelistbox within w_main1
The integer x=850
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull