Displaying Window Center In Oracle Forms10g at run time
Center a Window Automatically in Oracle Forms 10g at Runtime by this Process
# CREATE A PROCEDURE center-form IN THE program units LIKE-
PROCEDURE CENTER_FORM(MyWindowName IN varchar2,UpperMargin IN number) ISx number(6);
y number(6);
BEGIN
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,'ORACLE');
Set_window_property(forms_mdi_window,window_state,maximize);
x:=((get_window_property(forms_mdi_window,width)-get_window_property(MyWindowName ,width))/2);
y:=((get_window_property(forms_mdi_window,height)-get_window_property(MyWindowName ,height))/2+UpperMargin);
set_window_property(MyWindowName , position,x,y);
END;
# FORMS-LEVEL-TRIGGER:
Trigger Name:When-New-Form-Instance:
Declare
timer_id Timer ;
Begin
timer_id := Create_Timer( 'delay', 50, NO_REPEAT ) ;
End ;
Trigger Name:
When-Timer-Expired:
CENTER_FORM('WINDOW1',0);
it works only at new form :(
ReplyDelete