How can I correctly anchor or dock these two dataGridViews in WindowsForms?

Viewed 34

So I'm currently building a GUI for my application in WinForms inside Visual Studio and I am trying to fill the screen with two DataGridViews to display SQLServer data in.

In it's resizable mode it looks like this, which I am happy with; Picture 1

However once I full screen the GUI it looks like this; Picture 2

I've currently anchored the left datagridview to anchor to the top, left side and bottom. And the right datagridview to anchor to the top, right side and bottom.

I've also played around with docking, but this doesn't give the desired output (unless I am doing it incorrectly).

Here is also my code for anyone interested, it doesn't really have anything in it, but still;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;

namespace Broker_Monitor
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e) // Window
        {

        }

        private void run_button_mario_Click(object sender, EventArgs e) // Mario button
        {

        }

        private void run_button_peach_Click(object sender, EventArgs e) // Peach button
        {

        }

        private void datagridview_mario_CellContentClick(object sender, DataGridViewCellEventArgs e) // Mario
        {

        }

        private void datagridview_peach_CellContentClick(object sender, DataGridViewCellEventArgs e) // Peach
        {

        }
    }
}

Does anyone know how I can make it so there isn't a blank space in the middle of the GUI when I full screen the application?

Thank you for any feedback!

p.s Mario and Peach are just some test names to keep the two fields separated in my mind.

0 Answers
Related