VB.NET - Background fade like in the UAC message?

后端 未结 2 1038
名媛妹妹
名媛妹妹 2021-01-21 22:12

Hello,

When the UAC message is displayed in Windows Vista, 7 or 8 the background becomes inaccessible until the user selects from the message dialog. Ca

2条回答
  •  野的像风
    2021-01-21 22:47

    You are looking for ShowDialog(). This means it will bring the control in front of others and here's a quick example.

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim nform As New Form
        nform.Text = "Test Form"
        nform.ShowDialog()
    End Sub
    

    If you use BringToFront() method all this will do is bring it to front in the z-order. Same with TopMost(), but the only difference in TopMost() is that window will always be at top.

    Thanks! MrCodexer

提交回复
热议问题