VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > VB.net教程 >
  • vb.net教程之关闭窗体、创建一个透明度为75%的窗

.关闭窗体
窗体.Dispose
3. 创建一个透明度为75%的窗体
    Private Sub CreateMyOpaqueForm()
        ' Create a new form.
        Dim form2 As New Form()
        ' Set the text displayed in the caption.
        form2.Text = "My Form"
        ' Set the opacity to 75%.
        form2.Opacity = 0.75
        ' Size the form to be 300 pixels in height and width.
        form2.Size = New Size(300, 300)
        ' Display the form in the center of the screen.
        form2.StartPosition = FormStartPosition.CenterScreen
 
        ' Display the form as a modal dialog box.
        form2.ShowDialog()
 
4.用代码在窗体添加一个按钮.
 Dim button1 As New Button()
 
        ' Set the button to return a value of OK when clicked.
        button1.DialogResult = DialogResult.OK
 
        ' Add the button to the form.
        Controls.Add(button1)
        button1.Text = 123

相关教程