Apuna12
Apuna12

Reputation: 239

c# Append Windows Forms application to the right side and change resolution of everything else

I am creating the application which should be always on top and not minimizable / maximizable.

For now I have the following code snippet:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        this.StartPosition = FormStartPosition.Manual;
    }

    private void Form1_Load( object sender, EventArgs e )
    {
        this.Location = new Point( Screen.PrimaryScreen.WorkingArea.Right - this.Width + 8 );
        this.Height = Screen.PrimaryScreen.Bounds.Height;
        this.MinimizeBox = false;
        this.MaximizeBox = false;
        this.TopMost = true;
    }
}

Now this application is docked or placed on the right side of the screen. Now I need to adjust the resolution of everything else on the screen. I'll try to explain with the following image:

enter image description here

Explanation: There is an application which is always on top. "My app" is the application which I am working on and my idea is to "share the same spot" on the screen like said earlier.

I tried to look for some solutions like this one: https://www.c-sharpcorner.com/article/how-to-change-screen-resolution-in-C-Sharp/

but this only changes the resolution of the whole display. I need to leave resolution as it is in my application and resize everything else.

Is there a way to do it?

PS: If it is confusing in some way please let me know I will update the question.

Thanks

Upvotes: 0

Views: 160

Answers (0)

Related Questions