| ■No87011 (魔界の仮面弁士 さん) に返信 > 問題となっている個所のコードを提示することはできないのでしょうか?
iPic.Controls.Clear() '←ここ 'For Each l As Control In iPic.Controls ' If TypeName(l) = "Label" Then 'これだと頂点が残ってしまうコード ' iPic.Controls.Remove(l) ' End If 'Next '頂点すべてを作成 Refresh() Dim ps() As Point ps = iPic.PointN.ToArray For i As Long = 0 To UBound(ps) iLabel = New Label With iLabel .Width = 11 .Height = 11 .BackColor = Color.White .BorderStyle = BorderStyle.FixedSingle .Tag = i .Name = iPic.Name .Location = ps(i) .ContextMenuStrip = ContextMenuStrip1 '右クリックメニューの追加 End With iPic.Controls.Add(iLabel) AddHandler iLabel.MouseDown, AddressOf マウスダウンドラッグ開始 AddHandler iLabel.MouseMove, AddressOf マウスムーブドラッグ中 AddHandler iLabel.MouseUp, AddressOf マウスアップ GC.Collect(GC.MaxGeneration) Next |