1. 程式人生 > >pb 窗體控制元件等比例縮放

pb 窗體控制元件等比例縮放

在RESIZE事件中加入:
Int li_value
DragObject lw_obj
For li_value = 1 To UpperBound(This.Control[])
        lw_obj = control[li_value]
        lw_obj.x = lw_obj.x * (NewWidth / ii_width)
        lw_obj.width = lw_obj.width * (NewWidth / ii_width)
        lw_obj.y = lw_obj.y * (NewHeight / ii_height)
        lw_obj.height = lw_obj.height * (NewHeight / ii_height)
Next
ii_width = NewWidth
ii_height = NewHeight