Getsuyodev, Programming is mainly used when constructing an application. Programming requires knowledge of application domains, algorithms, and programming language expertise. Programming can be developed in different logic based on developer knowledge.

Keep Form on Top of All Other Windows



The System.Windows.Forms namespace contains classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows operating system. You can bring a Form on top of the application by merely setting the Form. Topmost form property to true will force the Form to the top layer of the screen while leaving the user able to enter data in the forms below.

Form2 frm = new Form2();
frm.TopMost = true;
frm.Show();

Topmost forms are always displayed at the highest point in the z-order of the windows on the desktop. You can use this property to create a form that is always displayed in your application, such as a MessageBox window.

using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
	public partial class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();
		}

		private void button1_Click(object sender, EventArgs e)
		{
			Form2 frm = new Form2();
			frm.TopMost = true;
			frm.Show();
		}
	}
}

Comments are closed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More