| How to Aling a Window [message #305086] |
Sat, 08 March 2008 05:15  |
*munnabhai* Messages: 70 Registered: March 2008 Location: Riyadh |
Member |
|
|
Hi All,
Can anyone tell me how to align a Window @ Centre during runtime?
Thanks in Advance...
Regards
|
|
|
| To Aling A Window [message #305145 is a reply to message #305086 ] |
Sun, 09 March 2008 04:22   |
aliarshad77 Messages: 3 Registered: March 2008 Location: Kingdom Of Saudi Arabia |
Junior Member |
|
|
To Align Window At Center Of The Screen
Resize Your Canvas
Take Width and Height Of Your Canvas From Canvas Property
Go To Window Property
Set Same Width And Height (Means Canvas & Window Same Height-Width)
Now Calculate From Calculator
580 - Window_Width / 2
324 - Window_Height / 2
For Example :-
Windows Width=367 & Height=232
Then Calculate From Calulator
580-367/2 Result Width =86.5
324-232/2 Result Height=46
Now Set 86 (86.5) On X Position Of Window
And Set 46 On Y Position Of Window
Close Property & Run Your Form
All The Best.....
|
|
|
| Re: How to Aling a Window [message #318807 is a reply to message #305086 ] |
Thu, 08 May 2008 01:11   |
*munnabhai* Messages: 70 Registered: March 2008 Location: Riyadh |
Member |
|
|
Dear Martin,
with this we have to give manually for all modules....i need a synchronise trigger what ever the resolution the form should be in center.
Regards
|
|
|
|
| Re: How to Aling a Window [message #318816 is a reply to message #305086 ] |
Thu, 08 May 2008 01:33  |
*munnabhai* Messages: 70 Registered: March 2008 Location: Riyadh |
Member |
|
|
try the below code
PROCEDURE center_form (winid varchar2 ) IS
w number;
h number;
md_w number;
md_h number;
BEGIN
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW, WINDOW_STATE ,MAXIMIZE);
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,'XYZ');
md_w :=get_window_property(forms_mdi_window,width)-5;
md_h :=get_window_property(forms_mdi_window,height)-20;
w :=get_window_property(winid,width);
h :=get_window_property(winid,height);
set_window_property(winid,x_pos,(md_w-w)/2);
set_window_property(winid,y_pos,(md_h-h)/2);
END;
call the above procedure in When-New-Form-Instance trigger
sure 100% will work what ever the resulution of the screen the form will be @ the centre of the screen.
Waiting for replies...
Regards
|
|
|