Hello there I'm trying to make TopMost toggle switch here's the code: private void bunifuiOSSwitch1_OnValueChange(object sender, EventArgs e)
private void bunifuiOSSwitch1_OnValueChange(object sender, EventArgs e)
{
Main main = new Main();
if(bunifuiOSSwitch1.Value == true)
{
main.TopMost = true;
}
else
{
main.TopMost = false;
}
}
At first it worked when toggled to true and worked when toggled to false but when I tried to retoggle it on it didn't worked after that I tried to change the code again but that didn't worked too... Now it doesn't even TopMost.
What you need to do is pass a reference to Main into your Settings form. One way to do this is when you call
Show()orShowDialog():Then, over in Settings, you can cast the
.Ownerproperty back to theMaintype and take action on it: