Home » Developer & Programmer » Forms » How to dynamically center a canvas (forms 12c)
How to dynamically center a canvas [message #659647] Wed, 25 January 2017 12:44 Go to next message
franckdev
Messages: 5
Registered: October 2016
Junior Member
Hi all i have a problem
I have a connection screen that I want to center compared to the size of the screen of my windows computer.
I wrote a procedure

PROCEDURE redim_win (win_name in varchar2)IS
win_id window;
mdi_width number;
win_width number;
BEGIN
  win_id:=find_window(win_name);
  ---mdi_width:=get_window_property('FORMS_MDI_WINDOW',width);
  win_width:=get_window_property(win_id,width);
  set_window_property(win_id,x_pos,(win_width)/3);
END;


But the screen is not dynamically centered. Because when I run on another computer the home screen is no longer centered.

Please, I need help
  • Attachment: screen.PNG
    (Size: 166.43KB, Downloaded 1155 times)
Re: How to dynamically center a canvas [message #659648 is a reply to message #659647] Wed, 25 January 2017 13:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

I doubt that ""x_pos,(win_width)/3" could center the window to anything.
Why "(win_width)/3" which set the position to one third of the screen would center?
The correct formula is "(screen_width-win_width)/2".

Re: How to dynamically center a canvas [message #659661 is a reply to message #659648] Thu, 26 January 2017 10:46 Go to previous messageGo to next message
franckdev
Messages: 5
Registered: October 2016
Junior Member
Hello you mean i put this code in the set_windows_property?
Re: How to dynamically center a canvas [message #659662 is a reply to message #659661] Thu, 26 January 2017 11:07 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This is the formula you have to use, where or how you get the values I don't know as I know nothing about Forms.

Previous Topic: Like MS Excel Formula
Next Topic: Showing only one record in Detail form (many to many relationship)
Goto Forum:
  


Current Time: Thu Mar 28 09:36:22 CDT 2024