Hi, I have created 2 forms.
Form1 and Form2
Form1 contains button to open form 2
Form2 contains a check box and ok button
When checkbox is checked and I click ok button, the TopMost property of form 1 is set true. But I m unable to see the change.
Help me out!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
This is form 1 code
namespace xyz
{
public partial class Form1 : Form
{
form2 pqr = new form2();
private void openform2_Click(object sender, EventArgs e)
{
pqr.Show();
}
}
}
Form 2 code
namespace xyz
{
public partial class Form2 : Form
{
form1 backform = new form1();
private void ok_Click(object sender, EventArgs e)
{
if (ontop.Checked == true)
{
backform.TopMost = true;
}
else
{
backform.TopMost = false;
}
}
}
}