【问题标题】:VB 2013: Enabling Aero on borderless formVB 2013:在无边界表单上启用 Aero
【发布时间】:2014-09-23 03:33:13
【问题描述】:

我正在寻找一种将 Windows 的 Aero 功能重新添加到 Visual Basic 2013 中的无边框窗体中的方法。我为标题栏编写了一个自定义组件,以允许为其设置我自己的背景/设计,如以及最小化、最大化和关闭按钮。但是,我遇到了一些问题,想办法让 Windows Aero 属性恢复正常,例如:

  • 将 拖动到屏幕的顶部或两侧以更改其大小
  • 调整大小/最小化/最大化时的动画

我正在制作一个自定义外观的表单,例如在 Google Chrome 和 Visual Studios 中找到的表单。 Aero 功能是我唯一的问题。有谁碰巧知道如何将它添加到 Visual Basic 2013 中的无边框表单中?

【问题讨论】:

    标签: vb.net aero borderless


    【解决方案1】:

    可能有帮助的部分答案:

    在没有表单边框的情况下,我能够使调整大小部分起作用的唯一方法是在所有侧面使用面板,使用鼠标事件来控制操作。面板是透明的,但鼠标输入事件也有助于更改光标事件。

    '**************************************************
        'MouseDown = User clicks the button
        'MouseMove = User is holding down the left mouse button and moves the mouse.  Simulates top of a regular form
        'MouseUp = User releases the mouse button 
        '**************************************************
        Private Sub Panel1_MouseDown(sender As Object, e As MouseEventArgs) Handles Panel1.MouseDown
            If e.Button = Windows.Forms.MouseButtons.Left Then
                drag = True
                mouse_x = Windows.Forms.Cursor.Position.X - Me.Left
                mouse_y = Windows.Forms.Cursor.Position.Y - Me.Top
            End If
        End Sub
        Private Sub Panel1_MouseMove(sender As Object, e As MouseEventArgs) Handles Panel1.MouseMove
            If drag Then
                Me.Top = Windows.Forms.Cursor.Position.Y - mouse_y
                Me.Left = Windows.Forms.Cursor.Position.X - mouse_x
            End If
        End Sub
        Private Sub Panel1_MouseUp(sender As Object, e As MouseEventArgs) Handles Panel1.MouseUp
            drag = False
        End Sub
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-21
      相关资源
      最近更新 更多