Home » Developer & Programmer » Forms » How to Aling a Window
How to Aling a Window [message #305086] Sat, 08 March 2008 05:15 Go to next message
*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

Confused
To Aling A Window [message #305145 is a reply to message #305086 ] Sun, 09 March 2008 04:22 Go to previous messageGo to next message
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 Go to previous messageGo to next message
*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 #318813 is a reply to message #318807 ] Thu, 08 May 2008 01:24 Go to previous messageGo to next message
djmartin
Messages: 7007
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Use the webutil or d2kwutil to get the screen sizes and then do the mathematics in a PLL library routine which is called by the When-New-Form-Instance trigger.

David
Re: How to Aling a Window [message #318816 is a reply to message #305086 ] Thu, 08 May 2008 01:33 Go to previous message
*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

Previous Topic:How to call a report?
Next Topic:Can't paste OS clipboard into Web ORACLE FORM
Goto Forum:
  


Current Time: Fri Jul 25 17:40:25 CDT 2008

Total time taken to generate the page: 0.04723 seconds
.:: Forum Home :: Site Home :: Wiki Home :: Contact :: Privacy ::.