VB.NET質問スレ (Part19)at TECH
VB.NET質問スレ (Part19) - 暇つぶし2ch604:デフォルトの名無しさん
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