VB6.0 Tree View 選單

點選form1裡面的樹枝狀裡的c

http://photo.pchome.com.tw/_manage/my_pic.html?s=s...

希望出現

http://photo.pchome.com.tw/_manage/my_pic.html?s=s...

是否有人了解這個【程式內容】是如何編寫的,謝!

1 Answer

Rating
  • 阿戊
    Lv 7
    1 decade ago
    Favorite Answer

    你是指按了 C 那一項就出現 Form2 表單 嗎???

    2008-03-12 21:24:10 補充:

    '在From1加入Treeview,再新增一個表單Form2

    Private Sub Form_Load()

    '以下為加入Treeview的節點

    TreeView1.Nodes.Add , , "A", "A"

    TreeView1.Nodes.Add "A", 4, "B", "B"

    TreeView1.Nodes.Add "B", 4, "C", "C"

    TreeView1.Nodes.Add "B", 4, "D", "D"

    TreeView1.Nodes.Add "B", 4, "E", "E"

    TreeView1.Nodes("C").EnsureVisible '展開

    End Sub

    Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)

    Select Case Node.Text

    Case "C" '選了 C 項目

    Form2.Show

    'Form2.Move Form1.Left + TreeView1.Left + TreeView1.Width, Form1.Top + TreeView1.Top + 30 * Screen.TwipsPerPixelY 'Form2移到指定位置

    'Case ...其它的項目判斷

    End Select

    End Sub

Still have questions? Get your answers by asking now.