Mono winforms app fullscreen in Ubuntu?

前端 未结 10 2314

Just wondering if there\'s a known way of getting a Mono System.Windows.Forms application to go fullscreen on Ubuntu/Gnome.

Mono is 2.4.2.3 Ubuntu is 9.10

Doing

相关标签:
10条回答
  • 2021-02-08 11:39

    Not sure what you mean by "Full Screen" - but I've written several Windows.Forms applications that take over the screen, and without a single PInvoke.

    Here's how I configure my main form ...

    Text = string.Empty; // No caption
    MaximizeBox = false;
    MinimizeBox = false;
    ControlBox = false;
    FormBorderStyle = None;
    WindowState = Maximized;
    

    Optionally,

    TopMost = true;
    

    Hope this helps.

    0 讨论(0)
  • 2021-02-08 11:43

    I have worked around this for now by setting the autohide property of the panel.

    Not ideal because it depends on the user changing their environment to use my application, but better than nothing.

    0 讨论(0)
  • 2021-02-08 11:44

    It should be possible to display every app running inside gnome in fullscreen mode with the "CTRL+F11" hotkey.

    Maybe you could try

    System.Windows.Forms.SendKeys.Send();
    

    but that is just a guess, I haven't got a Linux running atm to try this. But maybe this helps.

    0 讨论(0)
  • 2021-02-08 11:46

    Have you tried this?

      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;             
        this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
    

    Unfortunately I have no Ubuntu available right now, but I can see old patches for this in old mono versions...

    0 讨论(0)
  • 2021-02-08 11:54

    You need to disable visual effects in ubuntu.

    edit: And make sure your form size is at least screen resolution without borders. If borders are on design time and you are removing them in code you will need something like 1030x796 for a 1024x768 display.

    0 讨论(0)
  • 2021-02-08 11:56

    I can't test it at the moment, but have you tried a simple resize?

    form.FormBorderStyle = FormBorderStyle.None
    form.Location = Point(0, 0)
    form.Size = Screen.PrimaryScreen.Bounds.Size
    
    0 讨论(0)
提交回复
热议问题