0

enter image description hereenter image description here

I use Window form application and like in the pic the taskbar isn't appear and this is the problem to me how to can show the task bar this is the code of two buttons I want to show the taskbar when the form is maximum

Note: in the first the form will be in the center of screen and minima

   private void Button_Restore_Click(object sender, EventArgs e)
    {
        this.WindowState = FormWindowState.Normal;
     
        Button_Max.Visible = true;
        Button_Restore.Visible = false;        
    }
    private void Button_Max_Click(object sender, EventArgs e)
    {
         this.WindowState = FormWindowState.Maximized;
        Button_Restore.Visible = true;
        Button_Max.Visible = false;
    }
hana
  • 27
  • 5

2 Answers2

0

do this

private void Form1_Load(object sender, EventArgs e)
{
    this.TopMost = true;
    this.FormBorderStyle = FormBorderStyle.None;
    this.WindowState = FormWindowState.Maximized;
}

have a look to this How do I make a WinForms app go Full Screen

bigtheo
  • 624
  • 9
  • 16
  • but I also want the form to minimize . and I also see this "have a look to this How do I make a WinForms app go Full Screen" and its don't work – hana Jun 13 '21 at 21:46
  • this.WindowState = FormWindowState.Minmized; – bigtheo Jun 13 '21 at 21:52
0

This will make it "fullscreen" with the taskbar still showing.

private void Form1_Load(object sender, EventArgs e)
{
    this.Height = Screen.PrimaryScreen.WorkingArea.Height;
    this.Width = Screen.PrimaryScreen.WorkingArea.Width;
    this.Location = Screen.PrimaryScreen.WorkingArea.Location;
}
bg117
  • 354
  • 4
  • 13