VB.NET質問スレ (Part19) at TECH
[2ch|▼Menu]
604:デフォルトの名無しさん
07/02/12 23:49:02
>>598
別に役に立たない代物で、途中までで消えてないからいいって話は全然無いからw
Public Class Form6
  Private ContextMenuStrip1 As New ContextMenuStrip
  Private ContextMenuStrip2 As New ContextMenuStrip
  Private ToolStripMenuItem1 As New ToolStripMenuItem
  Private ToolStripMenuItem2 As New ToolStripMenuItem
  Private ToolStripMenuItem3 As New ToolStripMenuItem
  Private items As ToolStripItem()
  Private count As Integer
  Private Sub Form6_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    ToolStripMenuItem1.Text = "ToolStripMenuItem1"
    ToolStripMenuItem2.Text = "ToolStripMenuItem2"
    ToolStripMenuItem3.Text = "ToolStripMenuItem3"
    ContextMenuStrip1.Items.Add(ToolStripMenuItem1)
    ContextMenuStrip1.Items.Add(ToolStripMenuItem2)
    ContextMenuStrip1.Items.Add(ToolStripMenuItem3)
    count = ContextMenuStrip1.Items.Count

    items = New ToolStripItem(count - 1) {}
    Application.DoEvents()
    ContextMenuStrip1.Items.CopyTo(items, 0)
    Application.DoEvents() '<---- あんたの言ってるのはここまでの話でしょ。

    For i As Integer = 0 To count - 1
      ContextMenuStrip2.Items.Add(items(i))
    Next
    Application.DoEvents()
    Me.ContextMenuStrip = ContextMenuStrip1
    Label1.ContextMenuStrip = ContextMenuStrip2
  End Sub 
End Class


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5380日前に更新/270 KB
担当:undef