How do i keep a form on top of others
The Form class represents a window within an application. This includes dialog boxes, modeless windows, and Multiple Document Interface client and parent windows. In VB6 you can use a Win32API call to SetWindowPos to get a form to always stay on top. This has been simplified in VB.NET by setting Form's TopMost property as TRUE.
Dim frm As New Form2
frm.TopMost = True
frm.Show()
A topmost form is a form that overlaps all the other forms even if it is not the active or foreground form. You can use this property to create a form that is always displayed in your application, such as a MessageBox window.
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm As New Form2 frm.TopMost = True frm.Show() End Sub End Class
Related Topics
- Visual Studio IDE
- How to Create a vb.net Windows Forms Application
- Label Control
- Button Control
- TextBox Control
- ComboBox Control
- ListBox Control
- Checked ListBox Control
- RadioButton Control
- CheckBox Control
- PictureBox Control
- ProgressBar Control
- ScrollBars Control
- DateTimePicker Control
- Treeview Control
- ListView Control
- Menu Control
- MDI Form
- Color Dialog Box
- Font Dialog Box
- OpenFile Dialog Box
- Print Dialog Box
- KeyPress event in VB.NET
- How to create Dynamic Controls in VB.NET ?
- Timer Control - VB.Net