DODEFAULT() this.AddProperty('nOriginalHeight',this.Parent.Height) this.AddProperty('nOriginalWidth',this.Parent.Width) this.AdjustPositions("Init") this.lInitDone = .t.AdjustPositions
LPARAMETERS tcCalledFrom *=MESSAGEBOX(tcCalledFrom) thisform.LockScreen = .T. this.Anchor = 0 LOCAL lnAdjust, lnButtonsHeight, lnNewTop, lnBetweenListsSpace, lnExtraWidth, lnNewHeight lnNewHeight = (this.Height - this.lstDestination.Top - 2) STORE m.lnNewHeight TO this.lstDestination.Height, this.lstSource.Height lnButtonsHeight = (this.cmdRemoveAll.Top + this.cmdRemoveAll.Height) - this.cmdMoveOne.Top lnNewTop = this.lstDestination.Top + (m.lnNewHeight - m.lnButtonsHeight)/2 lnAdjust = m.lnNewTop - this.cmdMoveOne.Top this.cmdMoveOne.Top = m.lnNewTop this.cmdMoveAll.Top = this.cmdMoveAll.Top + m.lnAdjust this.cmdReMoveOne.Top = this.cmdReMoveOne.Top + m.lnAdjust this.cmdReMoveAll.Top = this.cmdReMoveAll.Top + m.lnAdjust lnBetweenListsSpace = this.lstDestination.Left - this.lstSource.Width lnExtraWidth = (this.Width - (2*this.lstDestination.Width + m.lnBetweenListsSpace))/2 STORE (this.lstDestination.Width + m.lnExtraWidth) TO this.lstSource.Width, this.lblDestination.Width STORE (this.cmdMoveAll.Left + m.lnExtraWidth) TO this.cmdMoveAll.Left, this.cmdMoveOne.Left, ; this.cmdReMoveAll.Left, this.cmdReMoveOne.Left this.lblDestination.Left = this.lblDestination.Left + m.lnExtraWidth this.lstDestination.Left = this.lstDestination.Left + m.lnExtraWidth STORE 45 TO this.lstDestination.Anchor, this.lstSource.Anchor STORE 768 TO this.cmdMoveAll.Anchor, this.cmdMoveOne.Anchor, this.cmdRemoveAll.Anchor, this.cmdRemoveOne.Anchor this.lblDestination.Anchor = 8 this.Anchor = 45 thisform.LockScreen = .F.And in the resize I have:
if this.lInitDone dodefault() else nodefault endifThe effect I observe is this - initially forms starts OK (the controls position itself). When I start changing size of the form, the listboxes grow wider, but the buttons could not keep up (the listboxes overlap the buttons).