4
I want to make a if
to know if the screen is in "Extend".
Example: (Win + P)
How can I do this in C#:
if (?) // só pode entrar no if, se a tela está no modo "Estender".
{
SegundaTela formulario = new SegundaTela();
Screen[] telas = Screen.AllScreens;
Rectangle bounds = telas[1].Bounds; // pode ser outro índice.
formulario.SetBounds(bounds.X, bounds.Y, bounds.Width, bounds.Height);
formulario.StartPosition = FormStartPosition.Manual;
formulario.Show();
}
There is no way to do this just with . NET, you will need to call the Windows C++ API. But what is your goal with that? Maybe detecting screen mode is unnecessary, if all you want is something like projecting on a specific screen.
– Oralista de Sistemas
@Renan, I asked a question here: https://answall.com/questions/245514/como-projetar-uma-imagem-no-tel%C3%A3o of how to project the screen. That’s why I asked the question here to know if PC is in "Extend" mode, because if user does not choose the extend option, the second screen (form) will not show on the screen, for example.
– Matheus Miranda
Somehow I need to show a warning to activate in "Extend".
– Matheus Miranda
I think you can see the screen size, if it is extended, the second screen will not have x=0
– Rovann Linhalis
It’s just a hunch... I’ll take a test
– Rovann Linhalis
It would serve to force the "extend"?
– vinibrsl
Yes, it could be @vnbrs
– Matheus Miranda