'Mouse Cursor on tablelayoutpanel

I have winform project that it has tablelayout panel. And i added pictureboxes to all cells.

I want the mouse cursor style to cross while on the tablelayoutpanel. So i changed cursor property of tablelayoutpanel and pictureboxes. It is working.

But while mouse pointer is switching tablelayoutpanel to picturebox, the cursor style changes to default on picturebox border line. How can i prevent that?

These are my codes;

private void Form1_Load(object sender, EventArgs e)
        {
            // Change tablelayout panel cursor style to cross.
            tlp1.Cursor = Cursors.Cross;

            // Change pictureboxes cursor style to cross.
            foreach (var pb in tlp1.Controls.OfType<PictureBox>())
            {
                pb.Cursor = Cursors.Cross;
            }
        }

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source