学院首页>网络编程>ASP.NET>运行时拉伸和移动控件的类

运行时拉伸和移动控件的类

作者: 来源: 添加时间:2006-5-21 19:56:42
  Private Sub MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)

  If frm Is Nothing Then

   Return

  End If

  ctrlIsResizing = False

  If Me.IsMoving Then

   ctrlRectangle.Location = New System.Drawing.Point(Me.ctrlLeft, Me.ctrlTop)

   ctrlRectangle.Size = New System.Drawing.Size(ctrlWidth, ctrlHeight)

   ControlPaint.DrawReversibleFrame(ctrlRectangle, Color.Empty, System.Windows.Forms.FrameStyle.Dashed)

   Me.ctrl.Left = Me.ctrlLeft - Me.frm.DesktopLocation.X - Me.Wtap

   Me.ctrl.Top = Me.ctrlTop - Me.frm.DesktopLocation.Y - Me.Htap

   Me.IsMoving = False

   Me.ctrl.Refresh()

   Return

  End If

  ctrlRectangle.Location = New System.Drawing.Point(Me.frm.DesktopLocation.X + Me.Wtap + Me.ctrl.Left, Me.frm.DesktopLocation.Y + Me.Htap + Me.ctrl.Top)

  ctrlRectangle.Size = New System.Drawing.Size(ctrlWidth, ctrlHeight)

  ControlPaint.DrawReversibleFrame(ctrlRectangle, Color.Empty, System.Windows.Forms.FrameStyle.Dashed)

  Me.ctrl.Width = ctrlWidth

  Me.ctrl.Height = ctrlHeight

  Me.ctrl.Refresh()

End Sub

End Class

第 3 页,共 3 页 [1] [2] [3]
站内搜索