无边框窗口怎样实现窗体缩放??

解决方案 »

  1.   

    你是不想让窗体的大小发生变化啊,me.height=高度  me.width=宽度
      

  2.   

    '加一个标签控件,其他的也可以
    Option ExplicitPrivate Sub Form_Load()
        Label1.BackColor = vbBlack
        Label1.Height = 200
        Label1.Width = 200
        Label1.Left = Me.Width - Label1.Width
        Label1.Top = Me.Height - Label1.Height
    End SubPrivate Sub Form_Resize()
        Label1.Left = Me.Width - Label1.Width
        Label1.Top = Me.Height - Label1.HeightEnd SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button <> 0 Then
            If Me.Width + X > 500 Then Me.Width = Me.Width + X
            If Me.Height + Y > 500 Then Me.Height = Me.Height + Y
        End If
    End Sub
      

  3.   

    Dim x1 As Single
    Dim y1 As Single
    Dim sfw As Boolean
    Dim sfh As BooleanPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If X > Form1.Width - 100 Then
    sfw = True
    x1 = X
    Form1.Print "zoom1"
    End IfIf Y > Form1.Height - 100 Then
    sfh = True
    y1 = Y
    Form1.Print "zoom2"
    End IfEnd SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)If sfw Then
    Form1.Width = Form1.Width - (x1 - X)
    x1 = X'Label1.Caption = X
    'Label2.Caption = Form1.WidthEnd IfIf sfh Then
    Form1.Height = Form1.Height - (y1 - Y)
    y1 = Y
    End IfEnd SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    sfw = False
    sfh = FalseEnd Sub模仿windows y有边框
      

  4.   

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button <> 0 Then
            If X > Me.Width - 500 Then Me.Width = X + 100
            If Y > Me.Height - 500 Then Me.Height = Y + 100
        End If
    End Sub