开发者

PowerBuilder window size

I'm having problem with the layout of a window after converting the application to web form. The window contains a datawindow. When I open the window in the internet explorer, initially the layout is ok, but as soon as I click on any control the layout breaks.

It breaks because the browser is opened in full size and it try to resize the objects on the window to bigger size. So I think the problem can be solved if the width and height of the width remains fixed.

I am opening the window using:

Message.StringParm = "w_test"
of_SendMessage("pfc_open")

Is t开发者_Go百科here anyway that I can force force the application to keep the fixed width and height of the w_test window?

I have tried following also, but it does not work (ie. breaks the layout).

OpenSheet (w_test, w_main_frame, 0, original!)


Your window should have a property called resizable, that can be set in the Window Painter (a check box) or via code like below. You may also need to turn off the control menu and minimize or maximize window buttons.

BUT... you have most likely looked at these and are not having luck with changing them. I have experienced the same problem (feature) using Web Forms and found no workaround or solution. Tried using all window types, resizing dynamically but IE always opens maximized.

If you haven't exhausted setting width and height dynamically you can do something like:

// Set window size and make it fixed
this.Width = 800
this.Height = 600

// Disallow Resize
this.Resizable = false

// Turn Off Minimize, Maximize & Control Menu
this.ControlMenu = false
this.Maxbox = false
this.Minbox = false

If you can't get the window to be fixed size and need to resort to something ugly, you might try some variation of this... in the resize event of the window. Not recommended, the window will probably flicker even with the use of redraw. The instance variable prevents your code from recursively triggering itself and ending with stack fault.

// force the window to be a size
if not ib_forcing_resize then
   if newwidth <> 800 or newheight <> 600 then
        ib_forcing_resize = true
        this.setredraw(false)
        this.width = 800
        this.height = 600
        this.setredraw(true)
        ib_forcing_resize = false
   end if
end if
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜