gooteis
gooteis

Reputation: 57

winforms - how to move a picturebox within a tableLayoutPanel?

i tried to use panels in each cells but the picturebox still wont move to another cell. thanks

Upvotes: 1

Views: 2140

Answers (1)

Akram Shahda
Akram Shahda

Reputation: 14781

Use the following:

tableLayoutPanel.Controls.Remove(button1);

// then:

tableLayoutPanel.Controls.Add(pictureBox, columnIndex, rowIndex);

Read about TableLayoutPanel:

TableLayoutPanel tutorial on csharp-online.net


If you wanted to implement Drag and Drop, you may get used from the following references:

A Simple Drag And Drop How To Example

Simple drag and drop example

Upvotes: 1

Related Questions