ComponentOne Window for ASP.NET AJAX: Window for ASP.NET AJAX Task-Based Help > Customizing the Dialog Window > Setting the Window Location

Setting the Window Location

You can control where the dialog window should initially appear through the StartPosition property. You can set the StartPosition property to ByDefault, Page, Parent, Manual, or OffSet. The default position for the dialog window is in the upper left corner of the Web page and by setting the StartPosition property to Manual you can control the exact location of the dialog window. You can easily set the dialog window's location in the designer or in code.

In Source View

To set the initial location of the C1Window dialog window add text to the <cc1:Window> tag so it appears similar to the following:

<cc1:C1Window ID="C1Window1" runat="server" StartPosition="Manual" X="200" Y="100">

    <CaptionButtons>

        <CollapseExpandButton Visible="False" />

        <CloseButton Visible="True" />

        <Icon Visible="True" />

        <MaximizeButton Visible="True" />

        <MinimizeButton Visible="True" />

        <PinButton Visible="False" />

        <ReloadButton Visible="False" />

    </CaptionButtons>

</cc1:C1Window>

In Design View

To set the initial location of the C1Window dialog window in the designer, complete the following steps:

Select the C1Window control and in the Properties window set the following properties:

      Set the StartPosition property to Manual. If the StartPosition property is set to something other than Manual, changes you make to the X and Y properties will not take effect.

      Set the X property to 200.

      Set the Y property to 100.

The dialog window will initially appear 200 pixels from the left and 100 pixels from the top of the Web page.

In Code

To set the initial location of the C1Window dialog window in code, add the following code to the Page_Load event:

      Visual Basic

C1Window1.StartPosition = C1WindowPosition.Manual

C1Window1.X = 200

C1Window.Y = 100

      C#

C1Window1.StartPosition = C1WindowPosition.Manual;

C1Window1.X = 200;

C1Window1.Y = 100;

This topic illustrates the following:

Run your application and note that the dialog window initially appears 200 pixels from the left and 100 pixels from the top of the Web page. For information about setting the dialog window's location at run time, see Setting the Dialog Window Location at Run Time.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.