Skip to Content
author's profile photo Former Member
Former Member

Dynamically resize DataWindow with Application Window

Hi,

I was just wondering if there was a way that I can set it so that my DataWindows and objects move and resize relative to the application window being resized.

For example I have the following which just has a few data windows and buttons on it.

But if the user resizes the application window, the DataWindows and buttons etc stay static in their fixed position, widths and heights.

Is there a way to make the buttons move and the DataWindows resize relative to the Application Window size?

thanks.

normal.jpg (48.7 kB)
Large.jpg (60.6 kB)
normal.jpg (48.7 kB)
Large.jpg (60.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2013 at 10:22 PM

    Yes. In the window resize event you can code that.


    Something basic like:

    dw_1.height = this.height * .9

    cb_1 = dw_1.X + dw_1.height

    etc. the resize event has parameters newwidth, newheight

    You can also use workspaceheight/width

    Take a look at the PFC if you want to see some advanced resizing options.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2013 at 11:43 PM

    If you use PFC, you should use the Resize service.

    If not, just code the window resize event.

    integer liMargin

    liMargin = dw_1.x

    // right datawindow stretch right and leave a margin

    dw_2.width = newwidth - dw_2.x - liMargin

    // right datawindow heighten but make room for buttons.

    dw_2.height = newheight - dw_2.y - cb_1.height - liMargin * 2

    dw_1.height = dw_2.height

    // glue buttons to bottom

    cb_1.y = newheight - cb_1.height - liMargin

    cb_2.y = cb_1.y

    ....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2013 at 12:15 AM

    I would suggest that you use the PFC resize service even if your application is not PFC based. You can just extract the related objects from the PFC and use them in your application. That would save you a lot of time.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2013 at 12:49 PM

    Have you thought about converting the app to WPF using PB.Net? The XAML features take care of the resizing for you.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.