0

私は動的な ComboBoxes を作成しています。また、各 ComboBox に ColorPicker を追加したいと考えています。しかし、残念ながら方法がわかりません。

何かアドバイスはありますか?

これが役立つ場合のコードは次のとおりです。

for (int i = 1; i < int.Parse(shapes)+1; i++)
                    {
                        System.Windows.Controls.ComboBox box = new ComboBox();

                        box.Height = 23;
                        box.Width = 70;
                        box.Items.Add("------");
                        box.Items.Add("Sphere");
                        box.Items.Add("Line");
                        box.Items.Add("Plane");
                        box.Items.Add("Pyramid");
                        box.Items.Add("Cylinder");
                        box.Items.Add("Cube");
                        box.SelectedIndex = 0;

                        box.Margin = new Thickness(0, -285 + i * 62, 375, 0);
                        box.Name = "box" + i.ToString();

                        grid2.Children.Add(box);
                    }

ありがとう。

4

1 に答える 1