Jan 26, 2018, 9:03 AM
[CLOSED] Show Window Centered in screen
Hi, I have a page with multiple buttons that show a Window, the problem is that all those buttons are in a different Y possition, so i would like to show the window centered in the screen (not in the page).
I have something like this:
(Buttons in my page are created dynamically)
¿Is there any way to center the window in the visual side of the page?
I have something like this:
(Buttons in my page are created dynamically)
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="columnlayout" AutoScroll="true" >
<Items>
<ext:Panel runat="server" id="panel1" ColumnWidth="1" Height="2000" Frame="true">
<Items>
<ext:Button runat="server" ID="button" Text="Show Window" Y="300">
<DirectEvents>
<Click OnEvent="ShowWindow"></Click>
</DirectEvents>
</ext:Button>
<ext:Button runat="server" ID="button2" Text="Show Window" Y="600">
<DirectEvents>
<Click OnEvent="ShowWindow"></Click>
</DirectEvents>
</ext:Button>
<ext:Button runat="server" ID="button1" Text="Show Window" Y="1200">
<DirectEvents>
<Click OnEvent="ShowWindow"></Click>
</DirectEvents>
</ext:Button>
<ext:Button runat="server" ID="button3" Text="Show Window" Y="1500">
<DirectEvents>
<Click OnEvent="ShowWindow"></Click>
</DirectEvents>
</ext:Button>
<ext:Button runat="server" ID="button4" Text="Show Window" Y="2000">
<DirectEvents>
<Click OnEvent="ShowWindow"></Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
<ext:Window runat="server" Closable="true" ID="win1" Hidden="true" height="600">
<Items>
<ext:Panel runat="server">
<Items>
<ext:Label runat="server" Text="hello"></ext:Label>
</Items>
</ext:Panel>
</Items>
</ext:Window>
</form>
</body>
protected void ShowWindow(object sender, EventArgs e)
{
win1.Hidden = false;
win1.Show();
}
I have tried to get the Y position of the button and use it on the window, but if the botton is at the lower of the page, the window gets "cutted.¿Is there any way to center the window in the visual side of the page?
Last edited by fabricio.murta; Feb 26, 2018 at 9:34 PM.